﻿/*create by liuxu 
*网才应聘管理弹框
*控件id格式统一，如文本框：
*txt_弹框模块_文本框内容（txt_sendmsg_content)
*页面变量存储InboxParams
*错误信息存存InboxParamsErr
*/
var isReloginTip = 1;

EHRBox.config = { "curBoxID": "" };
//打开弹框通用函数
EHRBox.ShowBox = function (obj) {
    //打开弹框
    EHR.ShowDivBox(obj);
    //绑定placeholder文案
    EHRBox.CreatePlaceholder(obj);
    //绑定文本框颜色更改事件
    EHRBox.RefreshBorderColor(obj);
    //居中
    MoveToCenter(document.getElementById(EHRBox.config.curBoxID));
}
//重新定义弹框层高度

EHRBox.RefreshShowBox = function (obj) {
    $(obj).css("height", null);
    EHR.ShowDivBox(obj)
    $(obj).css("height", null);
    MoveToCenter(document.getElementById(EHRBox.config.curBoxID));
}
//绑定文本框颜色更改事件

EHRBox.RefreshBorderColor = function (obj) {
    $(obj + " input").each(function () {
        var me = $(this);
        //文本框focus事件
        me.focus(function () {
            //更改文本框边框颜色--蓝色
            me.css("border-color", "#5191ce");
            //移除错误提示样式，全局统一写法
            me.parent('div').removeClass('active');
            if (me.attr('readonly') != 'readonly') {
                var ph = me.attr('placeholder');
                if (ph == me.val())
                    me.val("");
            }
        }).blur(function () {//文本框blur事件
            //更改文本框边框颜色--灰色
            me.css("border-color", "#c4c4c4");
            var ph = me.attr('placeholder');
            if (me.attr('readonly') != 'readonly' && (me.val() == '' || me.val() == ph)) {
                me.val(ph).css('color', '#b4b4b4');
            }
        }).keyup(function () {
            if (me.attr('readonly') != 'readonly') {
                var ph = me.attr('placeholder');
                if (ph != me.val())
                    me.css('color', '#3b3b3b');
            }
        });
    });
    $(obj + "  textarea").each(function () {
        var me = $(this);
        //文本框focus事件#5191ce 1px solid
        me.focus(function () {
            me.css("border-color", "#5191ce");
            //移除错误提示样式，全局统一写法
            if (me.siblings('span')) {
                if (me.parent('div').hasClass('active'))
                    me.siblings('span').html('');
            }
            me.parent('div').removeClass('active');
        }).blur(function () {
            me.css("border-color", "#c4c4c4");
        });
    });
}
//创建placeholder文案

EHRBox.CreatePlaceholder = function (obj) {
    //Ie浏览器设置
    if (navigator.userAgent.indexOf('MSIE') >= 0) {
        $(obj + " input").each(function () {
            var me = $(this);
            var ph = me.attr('placeholder'); //默认文案
            if (ph) {
                if (me.val() == "" || (me.val() == ph && !me.attr("readonly"))) {
                    me.val(ph).css('color', '#b4b4b4');
                }
            }
            if (typeof document.attachEvent != "undefined") {
                me[0].attachEvent("onpropertychange", function () {
                    if (me.val() == ph) {
                        return;
                    }
                    if (me.val() == "") {
                        me.css('color', '#b4b4b4')
                    }
                    else {
                        me.css('color', '#3b3b3b')
                    }
                });
            }
        });
    }
}
//隐藏弹框
EHRBox.ClickHide = function (obj) {
    $(obj).click(function (e) {
        var obj = e.srcElement ? e.srcElement : e.target;
        if (obj.tagName.toLowerCase() == "a" || obj.tagName.toLowerCase() == "i" || obj.tagName.toLowerCase() == "input") {
            return;
        }
        $(".downList").hide();
    });
}
EHRBox.CloseBox = function (obj) {
    EHR.CloseDivBox(obj);
}
//获取弹框统一方法,页面弹框只会存在一个，除导出之外
//增加以参数，getData:1时，从ajax获取弹框
EHRBox.GetBoxHtml = function (option) {
    var divBoxID = "div_" + option.doType.substring(3); //当前弹框ID
    EHRBox.config.curBoxID = divBoxID;
    //    //清除错误样式
    //    $('#' + divBoxID).find('.active').removeClass('active');
    if (option.getData) {
        var existFlag = 0;
        var postData = { "doType": option.doType };
        if ($("#" + divBoxID).length == 0) {
            $("body").append("<div class='panel_lnp'  id='" + divBoxID + "'></div>");
        }
        if ($("#" + divBoxID).html() == "") {
            $.ajax({
                type: "POST",
                async: false,
                dataType: 'xml',
                url: "../Ajax/Common/GlobalApplicationBoxAjax.aspx",
                data: postData,
                success: function (result) {
                    var msgtype = $(result).find("msgtype").eq(0).text();
                    var message = $(result).find("message").eq(0).text();
                    if (msgtype == "0") {
                        var returninfo = $(result).find("returninfo").eq(0).text();
                        EHR.ShowBox(returninfo);
                        existFlag = -1;
                        return;
                    }
                    if (message != "") {
                        $("#" + divBoxID).html(message);
                    }
                }
            });
        }
        else {
            existFlag = "1";
        }
        if (existFlag == -1) {
            return;
        }
    }
    var style;
    //设置弹框层高度样式
    style = { "width": null, "height": null };
    $("#" + divBoxID).css(style);
    //是否立即显示弹框
    if (typeof (option.showBox) == 'undefined' || option.showBox)
        EHRBox.ShowBox("#" + divBoxID);
    //重置弹框高度
    $("#" + divBoxID).css("height", null);
    //是否有回调事件
    if (typeof (option.callback) != "undefined") {
        option.callback();
    }
}
EHRBox.OpenBox = function (option) {
    EHRBox.GetBoxHtml(option);
}

//--------------------------------------------------------------------------------------------------------------
//页面点击事件，关闭标签与招聘流程
$(document).click(function (e) {
    e = e || window.event;
    var dom = e.srcElement || e.target;
    if (dom.id != "columnlabel" && dom.id != "columnprocess" && dom.id != "columnlabeli" && dom.id != "columnprocessi") {
        if (dom.id.indexOf("_containhistory") <= 0)
            $('#divdrop_process').hide();
        if (dom.id != "morelabel")
            $('#divdrop_label').hide();
        $('#div_filterLabel').hide();

    }
    if (dom.id != 'faster_label')
        $('#faster_label').remove();
});
$(document).ready(function () {
    $('#columnprocess').click(function () {
        InboxEngine.initDiv();
    });
    //error message 加载
    InboxEngine.GetErrorContent();
    //遮罩层resize
    $(window).resize(InboxEngine.setMask);
    //Safari 下拉菜单的mouseleave事件
    InboxEngine.disposeSafari();
});
//临时变量，自定义保存字段
var InboxParams = {};
//inbox对象
InboxEngine = {};
//收件箱初始化,初始化click事件
InboxEngine.Init = function () {
    //关键字
    $("#divdrop_process a").css({ "width": "110px" });
    $("#divdrop_process").css({ "height": "300px", "max-height": "300px", 'top': '30px', "width": "110px" });
    $("#ul_selectlist .downBox-s").each(function () {
        $(this).mouseleave(function () {
            if ($(this).children("input[type='text']").attr("readonly")) {
                $(this).children(".downList").hide();
                //$(this).children("input[type='text']").css("border-color", "#c4c4c4");
            }
        });
        var obj = $(this);
        $(obj).children("a").click(function () {
            obj.children("div.downList").show();
        });
        $(obj).children("input").click(function () {
            $(this).blur();
            $(this).siblings("a").click();
        });
    });
    //投递时间
    $("#divdrop_posttime a").click(function () {
        var id = $(this).parent().attr("id").replace("divdrop_", "");
        $("#hid_" + id).val($(this).attr("value"));
        $("#txt_" + id).val($(this).html());
        $("#btnPostTime").click();
        return false;
    });
    //招聘流程
    $("#divdrop_process a").click(function () {
        if ($(this).attr("href")) {
            var id = $(this).parent().attr("id").replace("divdrop_", "");
            $("#hid_" + id).val($(this).attr("value"));
            $("#txt_" + id).val($(this).html());
            $("#btnProcess").click();
            return false;
        }
    });
    //过滤简历
    $("#divdrop_resumefilter a").click(function () {
        var id = $(this).parent().attr("id").replace("divdrop_", "");
        $("#hidIsFilter").val($(this).attr("value"));
        $("#txt_" + id).val($(this).html());
        $("#btnSelect").click();
        return false;
    });
    //去重、有照片
    $("#ck_removerepeat,#ck_haspic").click(function () {
        $("#btnSelect").click();
    });
    if ($(".list-table tbody tr").length == 0) {
        $(".Search_page-numble").hide();
    }
    //排序
    $(".list-table thead .blue_link").click(function () {
        $("#hidSort").val($(this).attr("value"));
        $("#btnSort")[0].click();
        return false;
    });
    //默认显示字段
    EHRResumeList.userColl = $("#strSelectCols").val();
    if (lang == "en") {
        $("#DivCol").css("width", "530px");
    }
    //去重
    if ($("#hidHasPic").val() == "1") {
        $("#ck_removerepeat").attr("checked", true);
    }
    //查看全部简历
    $('#viewallresume').click(function () {
        $("#hid_posttime").val("");
        $("#btnPostTime").click();
        return false;
    });
    //查看近六个月简历
    $('#view6monthresume').click(function () {
        $("#hid_posttime").val("180");
        $("#btnPostTime").click();
        return false;
    });
    //简历投递时间
    $("#txt_posttime").val($("#divdrop_posttime a[value='" + $("#hid_posttime").val() + "']").text());

}
InboxEngine.InitLabel = function () {
    $('#columnlabel,#columnlabeli').click(function () {
        InboxEngine.GetDropLabelList();
    });
}
$(document).ready(function () {
    InboxEngine.InitLabel();
});
//批量导出跳转
InboxEngine.OpenBatchPageEngine = function (obj) {
    $(obj).attr({ 'target': '_blank', 'href': 'InboxTask.aspx?PageFrom=EMP' });
}
/*修改显示字段确认检查
*objid 弹层id,count最多选项

*/
InboxEngine.CloseColDiv = function (objid, count) {
    //判断选择项目大于10
    var chk = gid("cbxColumns").getElementsByTagName("Input");
    var j = 0;
    //1：checkbox是否存在
    if (chk != null) {
        if (chk.length != null) {
            //2：循环checkbox
            for (var i = 0; i < chk.length; i++) {
                //3：计算选中的checkbox
                if (chk[i].checked) {
                    j++;
                    //4:判断是否超出
                    if (j > count) {
                        //5： 超出，弹层提示
                        //EHR.ShowMsg(InboxParamsErr['max10item'].replace("{0}", count), false, 300);
                        EHR.ShowBoxTwo(InboxParamsErr['max10item'].replace("{0}", count), 300, false);
                        return false;
                    }
                }
            }
            //6:判断是否选中，没有选中，弹层提示
            if (j == 0) {
                //EHR.ShowMsg(InboxParamsErr['plasechoosecol'], false, 300);
                EHR.ShowBoxTwo(InboxParamsErr['plasechoosecol'], 300, false);
                return false;
            }
        }
    }
    //7：关闭弹层
    EHR.CloseDivBox("#" + objid);
    return true;
}
/*修改显示字段恢复
*vals默认显示字段

*/
InboxEngine.RestoreDefaultColDivByValue = function (vals) {
    var chk = gid("cbxColumns").getElementsByTagName("Input");
    //1：checkbox是否存在
    if (chk != null) {
        if (chk.length != null) {
            //2:循环checkbox
            for (var j = 0; j < chk.length; j++) {
                //默认显示字段
                if (vals.indexOf(chk[j].value) >= 0) {
                    chk[j].checked = true;
                } else {//不属于默认显示
                    chk[j].checked = false;
                }
            }
        }
    }
}
///*快捷标签--条件查询*/
InboxEngine.TermsLabel = 0; //是否设置点击事件，居中显示
InboxEngine.onlyLabel = 0;
InboxEngine.GetDropLabelList = function (flag, from, to) {
    typeof (flag) == undefined ? InboxEngine.onlyLabel = 0 : InboxEngine.onlyLabel = flag;
    //1：标签下拉框是否存在
    if (!from && $.trim($("#divdrop_label").html()) != "") {
        //1.1：存在且隐藏，显示标签下拉框
        if ($("#divdrop_label").is(":hidden")) {
            $(".downList").hide();
            $("#divdrop_label").show();
        }
        else {
            //1.2：存在且显示，隐藏标签下拉框
            $("#divdrop_label").hide();
        }
    }
    else {
        //2：不存在，请求标签div
        //$("#divdrop_label").html('');
        var folder = $("#hidFolder").val();
        var postData = { "doType": "GetTermsLabel", f: from ? from : 0, t: to ? to : 100, fl: folder };
        EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalInboxCommonAjax.ashx", postData, InboxEngine.GetDropLabelListResult, 0);
    }
}
/*快捷标签--条件查询--请求结果处理*/
InboxEngine.GetDropLabelListResult = function (result) {
    var msgtype = $(result).find("msgtype").eq(0).text();
    //1：请求成功
    if (msgtype && msgtype != "0") {
        //1.1:下拉框是否存在，不存在，创建
        if ($("#divdrop_label a").length < 1) {
            //标签div层//display: none;width:120px; max-height: 160px; margin-left: 68px; margin-top: 30px; z-index:200;
            var label = "<div class='downList' style='width: 104px; max-height: 160px; margin-left: 72px; margin-top: 33px; z-index: 200; display: block;' id='divdrop_label' onmouseleave='$(this).hide();'></div>";
            if (InboxEngine.onlyLabel == 0) {
                //含有标签与招聘流程
                $(".list-table").find(".th_downList  .downList").eq(0).before(label)
            } else {
                //只有标签
                $(".list-table").find("table").eq(0).before("<div class=\"th_downList\" >" + label + "</div>");
            }
            //1.2：绑定下拉框
            $("#divdrop_label").html($(result).find("returninfo").eq(0).text());
        }
        else {
            $("#divdrop_label a[tag=more]").remove();
            $("#divdrop_label a:last").after($(result).find("returninfo").eq(0).text());
        }
        if (!InboxEngine.TermsLabel && $("#divdrop_label a").length > 0) {
            //设置已选择的标签
            var hidlabid = $('#' + prefixControlID + 'hid_label').val();
            $("#divdrop_label a[tag='" + hidlabid + "']").css("color", "#ff9900");
            //$(".downList").hide();
            $("#divdrop_label").show();
            //1.3：定位标签下拉框位置//重新定位招聘流程弹层的位置
            InboxEngine.initDiv();
            //1.4：绑定下拉框选择事件
            $("#divdrop_label a").click(function () {
                //加载更多
                if ($(this).attr("tag") == 'more') {
                    //取100以后数据
                    InboxEngine.GetDropLabelList(InboxEngine.onlyLabel, 100, $(this).attr('num'));
                    InboxEngine.TermsLabel = 0;
                    return;
                }
                InboxEngine.SetLabel(this);
            });
            //1.5 Safari 下拉菜单的mouseleave事件
            InboxEngine.disposeSafari();
            //设置是否请求完成
            InboxEngine.TermsLabel = 1;
        }
    }
    else {
        //2：请求失败，弹框提示
        EHR.ShowBox($(result).find("returninfo").eq(0).text(), 300);
    }
}
//快捷查询标签
InboxEngine.SetLabel = function (obj) {
    $("#divdrop_label").hide();
    $('#' + prefixControlID + 'hid_label').val($(obj).attr("tag"));
    $('#' + prefixControlID + 'hid_titlelabel').val($(obj).attr("title"));
    $("#btnSelect").click();
}
/*招聘流程*/
InboxEngine.GetDropProcessList = function () {
    //2：下拉框是否隐藏，隐藏则显示
    if ($("#divdrop_process").is(":hidden")) {
        $(".downList").hide();
        $("#divdrop_process").show();
        //重新定位招聘流程弹层的位置
        InboxEngine.initDiv();
        var obj = $("#columnprocess");
        //定位下拉框位置
        //$("#divdrop_process").css({ "top": obj.offset().top + 15, "left": obj.offset().left});
        $("#divdrop_process a[value='" + $("#hid_process").val() + "']").css("color", "#ff9900");
    }
    else {
        $("#divdrop_process").hide();
    }
}
/*打开操作按钮弹层*/
InboxEngine.ShowOpeartorLayer = function (obj, layerid) {
    $(".btn-red").children("i").attr('class', "icon icon_caret_down_large_white");
    $(".list-table-er").hide();
    $(obj).find('i').attr('class', "icon icon_caret_up_large_white");
    var top = 0;
    var width = 80;
    //1：设置操作按钮高度
    switch (layerid) {
        case "ul_lablelist":
            top = $(obj).offset().top - 52;
            break;
        case "ul_movelist":
            var folder = $("#hidFolder").val();
            if (folder && folder == "BAK") top = 26;
            top += $(obj).offset().top - 75;
            var moveToInboxUnFilter = $("#moveToInboxUnFilter");
            if (moveToInboxUnFilter.length > 0) top -= 25;
            break;
        case "ul_recruitlist":
            width = 96;
            top = $(obj).offset().top - 125;
            break;
    }
    //2:设置定位操作按钮
    $("#" + layerid).css({
        left: $(obj).offset().left + "px",
        top: top + "px",
        "z-index": 200,
        width: width + "px"
    }).show();
    //3：清楚定时器
    if (typeof (interval) != "undefined") {
        clearTimeout(interval);
    }
    //4：设置鼠标悬浮事件

    $("#" + layerid).mouseover(function () {
        if (typeof (interval) != "undefined") {
            clearTimeout(interval);
        }
        $(this).show();
    }).mouseleave(function () {//5：设置鼠标移出事件
        //鼠标移出时开启定时器
        interval = setTimeout(function () { $("#" + layerid).hide(); $(obj).parent("div").removeClass("list-reset"); $(obj).children("i").attr('class', "icon icon_caret_down_large_white"); }, 1000);
    }).click(function () {
        $("#" + layerid).hide(); $(obj).parent("div").removeClass("list-reset"); $(obj).children("i").attr('class', "icon icon_caret_down_large_white");
    });
    //开启定时器
    interval = setTimeout(function () { $("#" + layerid).hide(); $(obj).parent("div").removeClass("list-reset"); $(obj).children("i").attr('class', "icon icon_caret_down_large_white"); }, 2000);
}

InboxEngine.IsMultiple = 0; //单个还是多个
/*打开公共弹层
*objType:弹层类型，操作按钮
*rowid：判断是单个操作还是多个
*selector:操作按钮列表
*isResumeView:是否是简历详情页面操作
*/
InboxEngine.Option = {};   //弹层控制选项参数
InboxEngine.OpenResumeCommonLayer = function (objType, rowid, selector, isResumeView, pageNo, pageEvent, ViewType) {
    //数据追踪,点击就记录
    if (pageNo) {
        EHR.Common_AsyncAddLog(pageNo, pageEvent, '');
    }
    //记录日志
    InboxParams['rowid'] = rowid; //不等于0，单个操作
    InboxEngine.AddLog(objType);

    InboxEngine.MsgBoxType = ""; //清空弹层类别
    InboxParams['selectedmail'] = ''; //清空已选择邮箱
    InboxParams['sendmobile'] = 0; //不检查短信输入
    $('#hidFolder').val() == "batch" ? InboxEngine.isBatch = 1 : InboxEngine.isBatch = 0; //是否简历批处理
    InboxParams['hidFolder'] = $('#hidFolder').val();
    if (!InboxEngine.isBatch) {
        if (!isResumeView) {
            //1:userid有值，单个操作
            if (rowid) {
                //InboxParams['hidUserID'] = userid;
                //1.1：单个操作对象
                var obj = $("input[type='checkbox'][rowid='" + rowid + "']");
                //取值
                InboxParams["hidSeqID"] = obj.attr("value1");
                InboxParams["hidJobID"] = obj.attr("value2");
                InboxParams['hidUserID'] = obj.attr("value");
                InboxParams['hidSource'] = obj.attr("source");
                InboxEngine.IsMultiple = 0;
            }
            else {
                //2：列表操作
                InboxEngine.GetSelectedValue('chkBox', "value1", "hidSeqID");
                InboxEngine.GetSelectedValue('chkBox', "value2", "hidJobID");
                InboxEngine.GetSelectedValue('chkBox', "value", "hidUserID");
                InboxEngine.GetSelectedValue('chkBox', "source", "hidSource");
                InboxEngine.IsMultiple = 1;
            }
            InboxParams['SourceCode'] = $("#pageNo").val(); //简历列表操作
        }
        else {
            if (InboxParams['hidFolder'] == "EMP") {
                InboxParams['SourceCode'] = 7;
            }
            InboxParams['isResumeView'] = isResumeView;
            //更改小精灵InboxParams时添加方法
            // InboxParams['SourceCode'] = '9'; //简历详情操作
            if ($("#tab_divUserList input[name='tab_chkUserID']:checked").length > 0 && InboxEngine.Option.IsDelete == undefined) {
                //多份简历情况
                InboxEngine.GetSelectedValue('tab_chkUserID', "value", "hidSeqID", true);
                InboxEngine.GetSelectedValue('tab_chkUserID', "value3", "hidJobID", true);
                InboxEngine.GetSelectedValue('tab_chkUserID', "value2", "hidUserID", true);
                InboxEngine.IsMultiple = 1;
            }
            else {
                //取值
                InboxParams["hidSeqID"] = $("#hidSeqID").val();
                InboxParams["hidJobID"] = $("#hidJobID").val();
                InboxParams['hidUserID'] = $("#hidUserID").val();
                InboxParams['hidSource'] = $("#hidSource").val();
                InboxEngine.IsMultiple = 0;

            }
        }
    }
    //3:判断是否有数据，除移动操作
    if (objType != "Move" && objType != "Label" && objType != "Recruit" && !InboxParams['hidUserID'] && !InboxEngine.isBatch && objType != "DelResume") {
        EHR.ShowBox(Msg_SelectResume, 300);
        return false;
    }
    //4：显示操作按钮||初始化弹框
    switch (objType) {
        case "Label": //标签按钮列表
            if (!isResumeView) {
                InboxEngine.ShowOpeartorLayer(selector, "ul_lablelist");
                break;
            }
            else {
                if (ViewType == 'addLabel') {
                    EHRLabelBox.AddLabel();
                    InboxEngine.AddResumeLog("17");
                    break;
                }
                else if (ViewType == 'delLabel') {
                    EHRLabelBox.RemoveLabel();
                    break;
                }
            }
        case "Move": //移动按钮列表
            if (!isResumeView) {
                InboxEngine.ShowOpeartorLayer(selector, "ul_movelist");
                break;
            }
            else {
                if (ViewType == 'recommond') {
                    InboxEngine.RePosition();
                    InboxEngine.AddResumeLog("9");
                    break;
                }
                else if (ViewType == 'rubish') {
                    InboxEngine.MoveToRub();
                    InboxEngine.AddResumeLog("18");
                    break;
                }
                else if (ViewType == 'companyHr') {
                    InboxEngine.MoveToHR();
                    InboxEngine.AddResumeLog("10");
                    break;
                }
            }
        case "Recruit": //招聘流程按钮列表
            if (!isResumeView) {
                InboxEngine.ShowOpeartorLayer(selector, "ul_recruitlist");
                break;
            }
            else {
                if (ViewType == 'screen') {
                    InboxEngine.Screen();
                    InboxEngine.AddResumeLog("11");
                    break;
                }
                else if (ViewType == 'forward') {
                    InboxEngine.Forward();
                    InboxEngine.AddResumeLog("12");
                    break;
                }
                else if (ViewType == 'intvplan') {
                    InboxEngine.IntvPlan();
                    InboxEngine.AddResumeLog("13");
                    break;
                }
                else if (ViewType == 'rms') {
                    InboxEngine.Rms();
                    InboxEngine.AddResumeLog("16");
                    break;
                }
                else if (ViewType == 'offer') {
                    InboxEngine.Offer();
                    InboxEngine.AddResumeLog("14");
                    break;
                }
            }
        case "SendMessage": //发送消息弹框
            InboxEngine.SendMessage();
            InboxEngine.AddResumeLog("7");
            break;
        case "Export": //导出弹框
            InboxEngine.Export();
            InboxEngine.AddResumeLog("6");
            break;
        case "FasterLabel": //快捷标签下拉框
            EHRLabelBox.GetDropLabelList(selector);
            break;
        case "ViewResume": //查看简历
            InboxEngine.ShowResumeView();
            break;
        case "ResumeMultiple": //查看简历多投
            InboxEngine.OpenMultiResume();
            break;
        case "Forward": //转发简历
            InboxEngine.Forward();
            InboxEngine.AddResumeLog("12");
            break;
        case "RePosition": //推荐职位
            InboxEngine.RePosition();
            InboxEngine.AddResumeLog("9");
            break;
        case "DelResume": //回收站-删除简历
            InboxEngine.DelResume.show();
            break;
        case "MoveHr": //回收站/简历批处理 -放入人才夹
            $('#hidMHrOk') ? InboxEngine.MoveHR.show($('#hidMHrOk').val() == "1") :
            InboxEngine.MoveHR.show();
            break;
        case "AddLabelLayer": //简历批处理 - 添加标签
            {
                EHRLabelBox.AddLabel();
                InboxParams['AddLabelType'] = objType;
                break;
            }
        case "DelLaberLayer":
            EHRLabelBox.RemoveLabel(); //删除简历标签
            break;
        case "MoveToRub": //放入回收站/简历批处理 - 放入回收站
            $('#hidMROk') ? InboxEngine.MoveToRub($('#hidMROk').val() == "1") :
            InboxEngine.MoveToRub();
            break;
        case "MoveToInboxUnFilter": //放入正常简历夹
            InboxEngine.MoveToInboxUnFilter();
            break;
        case "BlackList": //举报/黑名单
            EHRBlackList.PopupBlackList();
            InboxEngine.AddResumeLog("19");
            break;
        case "ToTemp": //放入暂存夹
            EHRToTemp.showDialog();
            break;
        case "DownLoad": //小精灵下载简历
            EHRDownLoad.showDialog();
            break;
        case"RecomTmp":

            break;
    }

}
InboxEngine.CheckSelData = function () {
    if (!InboxParams['hidUserID']) {
        EHR.ShowBox(Msg_SelectResume, 300);
        return 1;
    }
}
InboxEngine.DelErrTip = function () {
    $('#' + EHRBox.config.curBoxID).find('.active').removeClass('active');
    $('#' + EHRBox.config.curBoxID).find('.gdownList').hide();
    var msgType = InboxEngine.MsgBoxType;
    var deftip = '';
    if (msgType == 'export' || msgType == 'fwd') {
        deftip = InboxParams['deftip'];
        $('span[deftip="1"]').html(deftip);
    }
    //英文版导出样式
    if (msgType == 'export' && lang == "en") {
        $('[class$=square]').css({ 'right': '1px' });
    }
}
/*获取选择的check值，存入临时变量中
*getValue:是否取全部值，不区分简历是否可操作
*/
InboxEngine.GetSelectedValue = function (chkBoxName, attrName, hidID, getValue) {
    var str = "";
    //1：判断是否有选择checkbox,区分简历详情与列表
    if ($("input[name='" + chkBoxName + "']:checked").length > 0) {
        //2:循环循环checkbox
        $("[name='" + chkBoxName + "']").each(function () {
            //3：获取所有的值，不判断是否同步中，恶意简历
            if (getValue) {
                if ($(this).attr("checked")) {
                    //3.1:取值
                    if ($(this).attr(attrName) != undefined) {
                        str += $(this).attr(attrName).replace(",", "") + ",";
                    }
                }
            }
            else {
                //4：获取所有的值，判断是否同步中，恶意简历
                if ($(this).attr("checked")) {
                    //取有效的值，简历列用
                    var value3 = $(this).attr('value3');
                    if (value3 != undefined && value3 != null && value3 != '' && value3 == "0") {
                        //取正常简历的所需要的变量值
                        if ($(this).attr(attrName) != undefined) {
                            str += $(this).attr(attrName).replace(",", "") + ",";
                        }
                    }
                }
            }
        });
    }
    if (str != "") {
        str = str.substring(0, str.length - 1);
    }
    //5：给变量赋值
    InboxParams[hidID] = str;
}
//按钮列表打开弹层
InboxEngine.LayerClick = function (objType, rowid, obj) {
    InboxParams['showmovetoinboxunfilter'] = "1";
    InboxParams['rowid'] = rowid; //不等于0，单个操作
    //$('.list-table-er').hide();
    var divOperation = "divOperationBtn" + rowid;
    InboxEngine.OpenResumeCommonLayer(objType, rowid, obj);
    $("#" + divOperation).addClass("list-reset");
}
/*查看简历多份*/
InboxEngine.ShowResumeView = function () {
    //未选择简历，弹层提示
    if (!InboxParams['hidSeqID']) {
        EHR.ShowBox(Msg_SelectResume, 300);
        return;
    }
    $('#hidSeqID').val(InboxParams["hidSeqID"]);
    var URL = window.location.href;
    URL = URL.substring(URL.lastIndexOf("/") + 1, URL.length);
    $("#form1")[0].target = "_blank";
    $("#form1")[0].action = "../Candidate/ResumeViewFolder.aspx?pageCode=" + $("#pageNo").val();
    $("#form1")[0].submit();
    $("#form1")[0].target = "_self";
    $("#form1")[0].action = URL;
}
//是否需要重新登录
InboxEngine.IsReloginTip = function (result) {
    relogin = $(result).find("relogin").eq(0).text();
    returninfo = $(result).find("returninfo").eq(0).text();
    if (relogin == "1") {
        var box = $("#" + EHRBox.config.curBoxID);
        if (box.length > 0 && box.css('display') != "none") {
            EHR.ShowBoxTwo(returninfo, 300);
        }
        else {
            EHR.ShowBox(returninfo, 300);
        }
        return 1;
    }
    return 0;
}

/***********************Export*****************************/
/*导出 start*/
var EHRExportBox = {};
//是否已加载数据
EHRExportBox.IsLoad = 0;
//导出弹框
InboxEngine.Export = function () {
    //InboxEngine.AddLog('Export');
    //获取用户默认导出类型
    EHRExportBox.SetUserProfileDown();
    //首次弹框
    //EHRExportBox.Init();
}
/*1.设置默认的下载方式*/
EHRExportBox.SetUserProfileDown = function () {
    var postData = { doType: 'GetDefaultFormat' };
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalExportDivAjax.ashx", postData, EHRExportBox.SetUserProfileDownResult, 0);

}
/*1.1设置默认下载方式，初始化下载弹框，此弹框不重新获取*/
EHRExportBox.SetUserProfileDownResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var reportType = $(result).find("message").eq(0).text();
    if (reportType) {
        //绑定默认导出类型
        $("input[name='exportType'][value='" + reportType + "']").attr('checked', 'checked');
    }
    //初始化弹框
    EHRExportBox.Init();
}
/*2初始化导出简历弹框*/
EHRExportBox.Init = function () {
    //首次弹框
    InboxEngine.MsgBoxType = "export";
    if (InboxEngine.isBatch == 0) {
        EHRExportBox.ChangeDownType('0');
        $("input[name='downloadType'][value='0']").attr('checked', true);
    } else {
        EHRExportBox.ChangeDownType('1');
        $('.useText_bor').children("[class$='{0}']".format('clearfix')).eq(1).css('display', 'none');
        //IE7兼容
        if (browser.msie && browser.version < 8)
            $('#err_export_mailto_div').children("[class$='{0}']".format('square')).css("top", "3px");
    }
    if (EHRExportBox.IsLoad == 0) {
        InboxEngine.SetDefParamsByHtml();

        //绑定切换导出模式
        $("input[name='downloadType']").click(function () {
            EHRExportBox.ChangeDownType($(this).val());
        });
        EHRExportBox.IsLoad = 1;
        InboxParams['deftip'] = $('#txt_export_mailto').siblings('span').html();
    }
    EHRExportBox.SetUserData();
    EHRBox.OpenBox({ "doType": "GetExportBoxHtml" });
    InboxEngine.DelErrTip();
}
/*3.1设置导出相关信息*/
EHRExportBox.SetUserData = function () {
    if ($.trim($('#txt_export_mailto').val()) == '') {
        //4.获取自身email
        $("input[id='txt_export_mailto']").focus(function () {
            //有默认文案
            $('#txt_export_mailto').siblings('span').html(InboxParams['deftip']);
        });
        //绑定恢复模板
        $('#a_export_recover').click(function () {
            InboxEngine.RecoverTemplateContent(500);
        });
        //EHRBox.ClickHide("#" + EHRBox.config.curBoxID);
        $('#txt_export_mailto').siblings('a').click(function () {
            InboxEngine.FetchEmailDivData(); //绑定获取邮箱
        });
        //设置输入内容检查
        InboxEngine.InitChangeClick(500);
        //鼠标移出事件
        $('#txt_export_mailto').parent('div').mouseleave(function () {
            $('#div_export_mailtolist').hide();
        });
    }
    EHRExportBox.GetOwnEmail('export');
}
EHRExportBox.ChangeDownType = function (type) {
    //从页面下载
    if (type == "0") {
        $("#div_ExportBoxHtml .useText_info").hide();
        $('#a_export_preview').hide();
    } else {
        //发送到邮箱
        $("#div_ExportBoxHtml .useText_info").show();
        $('#a_export_preview').show();

    }
}
/*邮件预览*/
EHRExportBox.Preview = function () {
    if (EHRExportBox.CheckInputValue("1") == '1')
        return;
    var strPostdata = { content: encodeURIComponent($("#txt_export_content").val()), mailfrom: encodeURIComponent($('#txt_export_mailfrom').val()), pagefrom: 'export', f: $("#hidFolder").val(),s:InboxParams['hidSeqID']?InboxParams['hidSeqID']:'' };
    InboxEngine.Preview(strPostdata);
}
//发送邮件预览
InboxEngine.Preview = function (strPostdata) {
    var form = $("<form/>").attr('action', '../InboxResume/MailPreview.aspx').attr('method', 'post').attr('target', '_blank');
    var input;
    $.each(strPostdata, function (i, n) {
        input += '<input type="hidden" name="' + i + '" value="' + n + '" />';
    });
    form.append(input).appendTo("body").css('display', 'none').submit();
}
/*4.获取发送邮件信息*/
EHRExportBox.GetOwnEmail = function (type) {
    var postData = { "doType": "GetOwnEmail", t: type };
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalInboxCommonAjax.ashx", postData, EHRExportBox.GetOwnEmailResult);
}
/*4.1设置发送邮件信息*/
EHRExportBox.GetOwnEmailResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var userName = $(result).find("username").eq(0).text();
    var userEmail = $(result).find("useremail").eq(0).text();
    InboxEngine.SetUserTemplate(result);
    //设置默认内容
    if (InboxEngine.MsgBoxType == 'fwd') {
        $("#txt_" + InboxEngine.MsgBoxType + "_reply").css('color', '#3b3b3b').val(userEmail);
        var objSub = $("#txt_" + InboxEngine.MsgBoxType + "_sub");
        var subVal = InboxParams[InboxEngine.MsgBoxType]['defsub'];
        objSub.val(subVal.replace('{0}', userName));
        objSub.css('color', '#3b3b3b');
    }
    else {
        var objSub = $("#txt_" + InboxEngine.MsgBoxType + "_sub");
        objSub.val(InboxParams[InboxEngine.MsgBoxType]['defsub']);
        objSub.css('color', '#3b3b3b');
        $("#txt_" + InboxEngine.MsgBoxType + "_mailto").css('color', '#3b3b3b').val(userEmail);
        $("#hid_export_mailto").val(userEmail);
        InboxParams['exportmailreply'] = userEmail;
    }
    $("#txt_" + InboxEngine.MsgBoxType + "_mailfrom").css('color', '#3b3b3b').val(userName);
    InboxEngine.CheckContentLength(500);
    EHRBox.ShowBox("#" + EHRBox.config.curBoxID);
}

/*获取导出简历参数*/
EHRExportBox.GetStrExport = function () {
    //1.获取所在夹子
    var strExport = "";
    var resumeViewFolderType = document.getElementById("resumeViewFolderType");
    if ($("#hidFolder").length > 0) {
        var msghidFolder = InboxParams['hidFolder'];
        if (resumeViewFolderType != null && $("#hidFolder").val() == "TEMP" && resumeViewFolderType.value == "TEMP") {
            msghidFolder = "BAK";
        }
        strExport += "&f=" + msghidFolder;
    }
    //2.是否过滤简历
    if ($("#hidIsFilter").length > 0) {
        strExport += "&fi=" + $("#hidIsFilter").val();
    }
    //3.获取jobid,seqid
    if (InboxEngine.IsMultiple && InboxParams['isResumeView'] != "1") {
        InboxEngine.GetSelectedValue("chkBox", "value1", "hidSeqID");
        InboxEngine.GetSelectedValue('chkBox', "value2", "hidJobID");
    }
    if (InboxParams["hidSeqID"]) {
        if (resumeViewFolderType != null && $("#hidFolder").val() == "TEMP" && resumeViewFolderType.value == "TEMP") {
            strExport += "&s=" + $("#hidSeqIDTemp").val();
        }
        else {
            strExport += "&s=" + InboxParams["hidSeqID"];
        }
    }
    if (InboxParams["hidJobID"]) {
        strExport += "&j=" + InboxParams["hidJobID"];
    }
    //4.导出格式
    var exportFormat = "";
    $("[name='exportType']").each(function () {
        if ($(this).attr("checked")) {
            exportFormat = $(this).val();
            return false;
        }
    });
    //存入临时变量
    InboxParams['exportFormat'] = exportFormat;
    strExport += "&fa=" + exportFormat;
    if (strExport != "") {
        strExport = strExport.substring(1);
    }
    return strExport;
}
/*检查输入项是否合法*/
EHRExportBox.CheckInputValue = function (downloadType) {
    var strError = ""; //Interview_SendMail3
    //发送到邮箱才进行验证
    if (downloadType == "1") {
        //1.验证收件人邮箱
        if (!InboxEngine.CheckSendDataForEmail())
            strError = "1";
        //2.验证发件人
        var mailfrom = $("#txt_export_mailfrom").val();
        //2.1不能为空
        if (mailfrom.replace(/\s/gi, "").length < 1) {
            strError = "1";
            EHRExportBox.SetErrorMsg('mailfrom', InboxEngine.GetErrorTip(InboxParamsErr['commoncannotnull'], InboxParamsErr['mailusername']));
        }
        //2.2不能包含标签
        else if (EHR.hasHtmlTag(mailfrom)) {
            EHRExportBox.SetErrorMsg('mailfrom', InboxEngine.GetErrorTip(InboxParamsErr['commoncaninputtxt'], InboxParamsErr['mailusername']));
            strError = "1";
        }
        //3.验证主题，不能含有标签
        if (!InboxEngine.CheckSendDataForSub())
            strError = "1";
        //4.验证内容--不能含有标签
        if (!InboxEngine.CheckSendDataForContent(1))
            strError = "1";
    }
    return strError;
}
/*设置错误提示*/
EHRExportBox.SetErrorMsg = function (typeId, msg) {
    $('#txt_export_' + typeId).css('border-color', '');
    $('#err_export_' + typeId + '_span').html(msg);
    $('#err_export_' + typeId + '_div').addClass('active');
}
/*导出*/
EHRExportBox.Send = function () {
    //导出类型
    var downloadType = "0";
    $("input[name='downloadType']").each(function () {
        if ($(this).attr("checked")) {
            downloadType = $(this).val();
            return false;
        }
    });
    //如果是批量导出，则默认验证信息
    if (InboxEngine.isBatch)
        downloadType = "1";
    //验证输入项是否合法
    if (EHRExportBox.CheckInputValue(downloadType) == '1')
        return;
    //获取导出参数
    var strExport = EHRExportBox.GetStrExport();
    if (!InboxEngine.isBatch) {
        var postData = {
            doType: "GetExportID"//获取导出tokenid
        };
        var rand = Math.random();
        var useNewExport = 0;
        var export_val = "";
        var errMsg = "";
        postData.type = downloadType == "1" ? false : true;
        if (downloadType == "1") {
            postData.mailto = $.trim($("#txt_export_mailto").val()); //收件人
            postData.title = $.trim($("#txt_export_sub").val()); //主题
            postData.content = $.trim($("#txt_export_content").val()); //内容
            postData.mailfrom = $.trim($("#txt_export_mailfrom").val()); //发件人
            postData.reply = $.trim($("#hid_export_mailto").val()); //是否接受回复
        }
        var strLang = lang;
        if (strLang == "ch" || strLang == "") {
            strLang = "";
        }
        else {
            strLang = "en-us";
        }
        $.ajax({
            type: "POST",
            async: false,
            dataType: 'xml',
            url: "../Ajax/InboxResume/GlobalExportDivAjax.ashx",
            data: postData,
            success: function (result) {
                if (InboxEngine.IsReloginTip(result)) return;
                var msg = $(result).find("message").eq(0);
                export_val = msg.text();
                var msgtype = msg.find("msgtype").text();
                if ('0' == msgtype) {
                    $("#div_export_error").html(msg.find("returninfo").text());
                    useNewExport = 1;
                } else if (export_val.indexOf("tokenid") > 0 && export_val.length > 50) {
                    export_val += "&" + strExport;
                    //弹框进行导出
                    //?测试使用，送测需要调整为cvs.ehire.51job.com
                    window.open("http://cvs.ehire.51job.com/Download.aspx?num=" + rand + "&lang=" + strLang + "&" + export_val, "_blank", "Scrollbars=no,Width=430px,Height=240px,Top=240px,Left=280px,status=no,location=no");
                    useNewExport = 1;
                    var postData1 = postData;
                    postData1.doType = "EditMonitorLog"; //监控日志
                    postData1.downType = InboxParams['exportFormat'];
                    $.ajax({
                        type: "POST",
                        async: true,
                        url: "../Ajax/InboxResume/GlobalExportDivAjax.ashx",
                        data: postData1
                    });
                }
            }
        });
        if (useNewExport == 0) {

            EHR.ShowBoxTwo(InboxParamsErr['gettokeniderr'], 300);
            ajaxSendRequest("../Ajax/InboxResume/GlobalExportDivAjax.ashx?doType=OldExport&ety=newerr0&val=" + export_val + "&data=" + $.param(postData));
            return false;
        }
        else {
            EHRBox.CloseBox('#' + EHRBox.config.curBoxID);
            return true;
        }
    } else {
        //简历批处理 - 导出
        EHRExportBox.SendByBatch.send();
    }
}
/* 简历批处理 - 导出 */
EHRExportBox.SendByBatch = {
    send: function () {
        var postdata = {
            doType: 'BatMvHr',
            PageFrom: $('#hidPageFrom').val(),
            b: $('#hidMove').val(),
            c: InboxParams['exportFormat'],
            d: $('#hida').val()
        };
        //邮件参数
        postdata.mailto = $.trim($("#txt_export_mailto").val()); //收件人
        postdata.title = $.trim($("#txt_export_sub").val()); //主题
        postdata.content = $.trim($("#txt_export_content").val()); //内容
        postdata.mailfrom = $.trim($("#txt_export_mailfrom").val()); //发件人
        postdata.reply = $.trim(InboxParams['exportmailreply']); //是否接受回复
        EHR.Common_AsyncHandle("POST", "xml", "InboxResume/GlobalInboxRubAjax.ashx", postdata, EHRExportBox.SendByBatch.SuccHandler,1);
    },
    SuccHandler: function (result) {
        if (InboxEngine.IsReloginTip(result)) return;
        var msgtype = $(result).find("msgtype").eq(0).text();
        var returninfo = $(result).find("returninfo").eq(0).text();
        if (InboxEngine.isBatch) {
            if (msgtype == "1") {
                EHR.CloseDivBox('#div_ExportBoxHtml');
                EHR.ShowBox(Msg_Export.replace('@',returninfo), "230", "", 'InboxEngine.taskView();',1);
                //window.location.href = "InboxTaskView.aspx?PageFrom=" + $('#hidPageFrom').val();
            } else {
                if (!returninfo) {
                    EHR.ShowBoxTwo(Msg_Err, 300);
                }
		else if (returninfo == "0") {
                    EHR.ShowBoxTwo(taskconfirm, 300, true, 'EHR.CloseDivBox("#div_ExportBoxHtml");InboxEngine.taskContinue();', true, 'InboxEngine.closePage()');
                    //EHR.ShowBoxTwo(InboxParamsErr['taskconfirm'], 300, true, 'EHR.CloseDivBox("#div_ExportBoxHtml");InboxEngine.taskContinue();', true,'InboxEngine.closePage()');  
                } 
		else 
		{
                    // else EHR.ShowBox(returninfo, 300);
                    EHR.CloseDivBox('#div_ExportBoxHtml');
                    EHR.ShowBox(returninfo, 342);
                }
            }
        }
    }
}
/*导出 end*/

/********************End Export*****************************/

/********************RePosition*****************************/
//0:打开弹框提示
InboxEngine.RePosition = function () {
    InboxEngine.AddLog('RePosition');
    //0.1:判断是否可以进行操作
    if (InboxParams['isResumeView'] || EHRMoveResumt.CanMoveResume(0))
    //0.1：打开确认弹框，获取推荐职位弹框html
        EHR.ShowBox(InboxParamsErr['issurereposition'], "380", 1, 'EHRBox.OpenBox({ "doType": "GetRePositionBoxHtml", "callback": EHRRePositionBox.Init ,showBox:0})');
}
/* 推荐职位 begin */
var EHRRePositionBox = {};
//是否选择职位
EHRRePositionBox.IsSelectJob = 0;
//是否是首次请求
EHRRePositionBox.IsFirstGetJob = 1;
//1.初始化弹框
EHRRePositionBox.Init = function () {
    //1.1:初始化公司部门下拉框
    if (EHRRePositionBox.IsFirstGetJob) {
        InboxEngineJob.InitComDiv("#drop_reposcompany_box,#drop_reposdivision_box");
        //初始化职位名输入获取焦点事件
        $('#txt_reposjobname').focus(function () {
            $('#err_reposdivision').removeClass('active');
        });
        //确定事件
        $("#" + EHRBox.config.curBoxID).find('a#reposition_btn').click(function () {
            EHRRePositionBox.Send();
        });
        EHRRePositionBox.IsFirstGetJob = 0;
    }
    //弹框重新查数据
    $('#txt_reposcompany_box,#txt_reposdivision_box').css('color', '#bfbfbf').val(InboxParamsErr['unlimite']);
    $('#txt_reposjobname').val((navigator.userAgent.indexOf('MSIE') >= 0 ? InboxParamsErr['plaseinput'] : ""));
    $('#txt_reposjobname').css('color', '#b4b4b4');
    //$('#txt_reposjobname').css('color', '#b4b4b4');
    $('#hid_reposcompany_box,#hid_reposdivision_box').val('');
    InboxEngine.DelErrTip();
    //1.2:获取正在发布中的推荐职位列表
    EHRRePositionBox.GetRePositionJobByTerms(0);
}
//根据条件获取发布中职位
EHRRePositionBox.GetRePositionJobByTerms = function (index) {
    //清除错误
    $('#err_reposnojob').css('display', 'none');
    //判断职位名称
    var jobname = $.trim($('#txt_reposjobname').val());
    if (jobname != '') {
        //是否含有标签
        if (EHR.hasHtmlTag(jobname)) {
            $('#txt_reposjobname').css('border', '');
            $('#err_reposdivision').addClass('active');
            return;
        }
    }
    //如果是请输入，职位名称置为空
    var jobname = $('#txt_reposjobname').val();
    jobname = jobname == InboxParamsErr['plaseinput'] ? "" : jobname;
    var postData = { doType: 'GetRePositionJob', c: $('#hid_reposcompany_box').val(),
        d: $('#hid_reposdivision_box').val(), n: encodeURIComponent(jobname), page: index
    };
    //获取推荐职位
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalInboxCommonAjax.ashx", postData, EHRRePositionBox.GetRePositionJobByTermsResult);
}
//2.1填充发布职位至html*/
EHRRePositionBox.GetRePositionJobByTermsResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var msgtype = $(result).find("msgtype").eq(0).text();
    if (msgtype && msgtype == '1') {
        var returninfo = $(result).find("returninfo").eq(0).text().split('$$');
        var jobinfo = returninfo[0]; //职位信息
        var pagebottom = returninfo[1]; //页脚翻译
        //填充职位列表
        var isstandard = $(result).find("isstandard").eq(0).text();
        if (isstandard == '0') {
            $('#dl_company,#dl_division').css('display', 'none');
        }
        $("#ul_repositionjobs").html(jobinfo);
        //填充页脚
        $("#job_pagebottom").html(pagebottom);

        var box = $("#" + EHRBox.config.curBoxID);
        //绑定选择职位事件
        box.find('label.usxText_pt').click(function () {
            EHRRePositionBox.IsSelectJob = 1;
            $('#err_reposnojob').css('display', 'none');
            InboxParams["hidJobID"] = $(this).find('input').attr("value");
        });
        box.css("height", null);
        //点击翻页事件请求，清空选择的jobid,设置是否选择职位为未选择
        EHRRePositionBox.IsSelectJob = 0;
        InboxParams["hidJobID"] = '';
        //隐藏错误信息
        $('#err_reposnojob').css('display', 'none');
        EHRBox.ShowBox("#" + EHRBox.config.curBoxID);
        $("#repositionjobtitle").scrollTop(0);
    }
    else {
        EHR.ShowBox($(result).find("returninfo").eq(0).text(), 300);
    }
}
//3.推荐职位*/
EHRRePositionBox.Send = function () {
    if (!EHRRePositionBox.IsSelectJob) {
        //3.1未选择职位，提示错误信息
        $('#err_reposnojob').css('display', 'block');
        return;
    }
    var strSeqId = InboxParams['hidSeqID'];
    var strFolder = InboxParams['hidFolder'];
    var resumeViewFolderType = document.getElementById("resumeViewFolderType");
    if (resumeViewFolderType != null && $("#hidFolder").val() == "TEMP" && resumeViewFolderType.value == "TEMP") {
        if ($("#hidSeqIDTemp").val() != "") {
            strSeqId = $("#hidSeqIDTemp").val();
            strFolder = "BAK";
        }
    }

    var postData = { doType: "RePositionJob", s: strSeqId, j: InboxParams['hidJobID'], f: strFolder, fi: $('#hidIsFilter').val(), SourceCode: InboxParams['SourceCode'] };
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalInboxCommonAjax.ashx", postData, EHRRePositionBox.SendResult);
}
//3.1推荐职位后失败||成功操作*/
EHRRePositionBox.SendResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    //关闭当前弹层
    if (EHRBox.config.curBoxID)
        EHRBox.CloseBox('#' + EHRBox.config.curBoxID);
    if (!InboxParams['isResumeView']) {
        var type = $(result).find("message").eq(0).text();
        if (type == "2") {
            var tipTitle = "信息提示";
            var okText = "确定";
            if (lang == "en") {
                tipTitle = "Message Tip";
                okText = "Confirm";
            }
            var click = "EHR.CloseDivBox('#repositionjob_msgbox');$('#btnSelect').click();";
            var msgbox = "<div class='panel_lnp panel_size_s' id='repositionjob_msgbox'><h2><p>" + tipTitle + "</p><a href=\"" + click + "\"><i class=' icon icon_remove_white'></i></a></h2><div class='pannel_body'><div class='panelBtn_box'><p class=' hint font_left'>" +
    $(result).find("retutninfo").eq(0).text() + "</p><a href=\"" + click + "\" class='panel_btn_s'>" + okText + "</a></div></div></div>";
            EHR.CloseDivBox('#repositionjob_msgbox');
            //EHR.ShowBox($(result).find("retutninfo").eq(0).text(), 0, 0, "$('#btnSelect').click();");
        }
        else {
            var isShow = $("#hidDisplayType").val() || '0';
            $('#hidRefresh').val('1');
            if (isShow == "1") {
                $("#btnDetailDis").click();
            }
            else {
                $("#btnSampleDis").click();
            }
        }
    }
    else {
        var viewFolder = window.document.getElementById("resumeViewFolderType");
        var hidFolder = window.document.getElementById("hidFolder");
        if (viewFolder != null && hidFolder != null && viewFolder.value == "TEMP" && hidFolder.value == "TEMP") {
            $("#AD_btnRefreshNew").click();
        }
        else {
            $("#AD_btnRefresh").click();
        }
    }
}

/* 推荐职位 end */
/********************End RePosition*****************************/

/**********************Move HR***************/
EHRMoveResumt = {};
//是否需要提示,移入回收站不需要考虑简历是否同步、黑名单
EHRMoveResumt.CanMoveResume = function (getValue) {
    //多个简历需要重新判断是否可以移动
    if (InboxEngine.IsMultiple && InboxParams['isResumeView'] != "1") {
        //重新获取数据
        InboxEngine.GetSelectedValue('chkBox', "value1", "hidSeqID", getValue);
        //是否可以移动
        if (InboxParams['hidSeqID'] == undefined || InboxParams['hidSeqID'] == '') {
            //提示错误信息
            EHR.ShowBox(Msg_SelectResume, 300);
            return 0;
        }
        else {
            return 1;
        }
    }
    else {
        //单个简历不需要检查，直接返回
        return 1;
    }
}
/*放入正常简历夹 start*/
InboxEngine.MoveToInboxUnFilter = function () {
    InboxEngine.AddLog('MoveToInbox');
    if (EHRMoveResumt.CanMoveResume(0)) {
        var postData = { doType: 'MoveToInboxUnFilter', s: InboxParams['hidSeqID'], f: InboxParams['hidFolder'], j: InboxParams['hidJobID'], filter: InboxEngine.GetIsFilter(), source: InboxParams['SourceCode'] };
        EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalInboxCommonAjax.ashx", postData, EHRRePositionBox.SendResult);
    }
}
/*放入人才夹 end*/
/*放入人才夹 start*/
InboxEngine.MoveToHR = function () {
    InboxEngine.AddLog('MoveToHR');
    if (InboxParams['isResumeView'] || EHRMoveResumt.CanMoveResume(0))
    //确认弹层
        EHR.ShowBox(InboxParamsErr['issuremovetohr'], "380", 1, 'EHRMoveResumt.MoveToHRHandle();');

}
/*放入人才夹操作*/
EHRMoveResumt.MoveToHRHandle = function () {
    var postData = { doType: 'MoveToHR', s: InboxParams['hidSeqID'], f: InboxParams['hidFolder'], filter: InboxEngine.GetIsFilter(), source: InboxParams['SourceCode'] };
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalInboxCommonAjax.ashx", postData, EHRRePositionBox.SendResult);
}
/*放入人才夹 end*/
/*********************End Move HR***************/
/**********************Move Rub***************/
/*放入回收站 start*/
InboxEngine.MoveToRub = function (aut) {
    InboxEngine.AddLog('MoveToRub');
    //判断是否可移动
    if (InboxParams['isResumeView'] || EHRMoveResumt.CanMoveResume(1))
    //确认弹层
        if (InboxEngine.isBatch) {
            //权限不足，直接退出
            if (!aut) {
                EHR.ShowBox(moverbWarning, 356);
                //EHR.ShowBox(InboxParamsErr['moverbWarning'], 356);
                return false;
            }
            EHR.ShowBox(moverbconfirm, 300, true, 'EHRMoveResumt.MoveToRubHandleBat();', false, true);
            //EHR.ShowBox(InboxParamsErr['moverbconfirm'], 300, true, 'EHRMoveResumt.MoveToRubHandleBat();', false, true);
        } else {
            EHR.ShowBox(InboxParamsErr['issuremovetorub'], 380, 1, 'EHRMoveResumt.MoveToRubHandle();');
        }
}
/*放入回收站操作*/
    EHRMoveResumt.MoveToRubHandle = function () {
        var strSeqId = InboxParams['hidSeqID'];
        var strFolder = InboxParams['hidFolder'];
        var resumeViewFolderType = document.getElementById("resumeViewFolderType");
        if (resumeViewFolderType != null && $("#hidFolder").val() == "TEMP" && resumeViewFolderType.value == "TEMP") {
            if ($("#hidSeqIDTemp").val() != "") {
                strSeqId = $("#hidSeqIDTemp").val();
                strFolder = "BAK";
            }
        }
        var postData = { doType: 'MoveToRub', s: strSeqId, f: strFolder, filter: InboxEngine.GetIsFilter(), source: InboxParams['SourceCode'] };
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalInboxCommonAjax.ashx", postData, EHRRePositionBox.SendResult);
}

/*简历批处理-放入回收站*/
EHRMoveResumt.MoveToRubHandleBat = function () {
    InboxEngine.WhileDoTask("disabled"); 
    var postdata = {
        doType: 'BatMvHr',
        PageFrom: $('#hidPageFrom').val(),
        b: $('#hidMove').val(),
        d: $('#hida').val()
    }
    EHR.Common_AsyncHandle("POST", "xml", "InboxResume/GlobalInboxRubAjax.ashx", postdata, EHRMoveResumt.MoveToRubResult,1);
}
/*移动结果*/
EHRMoveResumt.MoveToRubResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    /*以下为简历批处理-放入回收站 结果集处理*/
    var msgtype = $(result).find("msgtype").eq(0).text();
    var returninfo = $(result).find("returninfo").eq(0).text();
    if (InboxEngine.isBatch) {
        if (msgtype == "1") {
             EHR.ShowBox(Msg_MoveRub.replace('@',returninfo), "278", "", 'InboxEngine.taskView();',1);
            //window.location.href = "InboxTaskView.aspx?PageFrom=" + $('#hidPageFrom').val();
        }else {
             if (!returninfo) {
                  EHR.ShowBox(Msg_Err, 300);
                }else if (returninfo == "0"){
                  EHR.ShowBox(taskconfirm, 300, true, 'InboxEngine.taskContinue()', true, 'InboxEngine.closePage()');
                //EHR.ShowBox(InboxParamsErr['taskconfirm'], 300, true, 'InboxEngine.taskContinue()', true,'InboxEngine.closePage()');    
                }
            else EHR.ShowBox(returninfo, 300);
        }
        InboxEngine.WhileDoTask(""); 
    }
}
/*放入回收站 end*/
/*********************End Move Rub***************/

/********************Add/Del Label****************/
/* 添加标签/删除标签 start*/
var EHRLabelBox = {};
//是否是快捷添加标签
EHRExportBox.IsFasterLabel = 0;
EHRLabelBox.IsGetFirst = 1;
//添加标签
EHRLabelBox.AddLabel = function () {
    //wei选择数据，直接返回
    if (!InboxEngine.isBatch && InboxEngine.CheckSelData()) return;
    InboxEngine.AddLog('AddLabel');
    EHRExportBox.IsFasterLabel = 0;
    $("#ul_lablelist").hide();
    $('#txt_lbl_title').bind('paste keyup', function () {
        InboxParams['labelID'] = '';
    });
    //打开标签弹层
    EHRBox.OpenBox({ "doType": "GetAddLabelBoxHtml", "callback": EHRLabelBox.FetchLabel, showBox: 0 });
}
/*获取常用标签*/
EHRLabelBox.FetchLabel = function () {
    var postData = { "doType": "GetLasterLabel", t: '1' };
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalInboxCommonAjax.ashx", postData, EHRLabelBox.SetFetchLabel);

}
/*填充常用标签*/
EHRLabelBox.SetFetchLabel = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    $('#txt_lbl_title').css("color", "#b4b4b4"); //初始化默认文字颜色
    $('#txt_lbl_title').val((navigator.userAgent.indexOf('MSIE') >= 0 ? $('#txt_lbl_title').attr('placeholder') : ""));
    InboxEngine.DelErrTip();
    var type = $(result).find("msgtype").eq(0).text();
    if (type == '1') {
        $('#div_lbl_titlelist').html($(result).find("returninfo").eq(0).text());
    }
    if (InboxParams['isResumeView'] == "1" && (!InboxParams['AddLabelType'])) {
        $("#txt_evalue_content").val("");
        $("#dl_evalue").show();
        InboxEngine.MsgBoxType = "evalue";
        if (EHRLabelBox.IsGetFirst) {
            InboxEngine.SetDefParamsByHtml();
            InboxEngine.InitChangeClick(1000);
            EHRLabelBox.IsGetFirst = 0;
        }
        InboxEngine.CheckContentLength(1000);
    }
    //显示弹框
    EHRBox.ShowBox("#" + EHRBox.config.curBoxID);
}
//快捷标签--添加
EHRLabelBox.MouseEvent = null;
EHRLabelBox.MouseEventXY = { x: 0, y: 0 };
EHRLabelBox.GetDropLabelList = function (event) {
    //InboxEngine.AddLog('FasterLabel',event);
    //快捷标签
    EHRExportBox.IsFasterLabel = 1;
    EHRLabelBox.MouseEvent = event;
    EHRLabelBox.MouseEventXY.x = event.clientX;
    EHRLabelBox.MouseEventXY.y = event.clientY;
    $('div[id^="faster_label"]').remove();
    var postData = { "doType": "GetLasterLabel", t: '0' };
    //获取快捷标签div
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalInboxCommonAjax.ashx", postData, EHRLabelBox.GetDropLabelListResult, 0);

}
//快捷标签--获取标签div结果
EHRLabelBox.GetDropLabelListResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var msgtype = $(result).find("msgtype").eq(0).text();
    if (msgtype != "0") {
        //定位、填充div
        //$('span[name="LABELID_{0}"]'.format(InboxParams['hidSeqID'])).before($(result).find("returninfo").eq(0).text());
        //绑定鼠标移除事件
        //        $('#faster_label').parent('td').mouseleave(function () {
        //            $(this).find('div').remove();
        //        });
        //$('#faster_label').remove();
        $("body").append($(result).find("returninfo").eq(0).text());
        var e = EHRLabelBox.MouseEvent || window.event || getEvent();
        var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
        var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
        var clientT = document.documentElement.clientHeight;
        //兼容IE7.8
        var x = e.pageX || (e.clientX ? e.clientX + scrollX : EHRLabelBox.MouseEventXY.x + scrollX);
        var y = e.pageY || (e.clientY ? e.clientY + scrollY : EHRLabelBox.MouseEventXY.y + scrollY);
        var obj = $("#faster_label");
        obj.css({
            "z-index": 200,
            position: "absolute"
        }).show();
        var fh = obj.find('div.downList').height(); //快捷添加标签div高度
        if (y - scrollY + fh > clientT)
            y = y - fh;
        obj.css({
            left: x + "px",
            top: y + "px"
        });
        obj.mouseleave(function () {
            $(this).remove();
            EHRLabelBox.MouseEvent = null;
        });

        //绑定点击标签事件
        $("#faster_label a").click(function () {
            var tag = $(this).attr("tag");
            //增加判断
            if (!tag&&tag!='') return;
            InboxParams['labelID'] = $(this).attr("tag");
            InboxParams['labelTxt'] = $(this).text();
            //移除快捷标签div
            $(this).parent('td').find('div').remove();
            EHRLabelBox.MouseEvent = null;
            //保存标签
            EHRLabelBox.SaveLabel();
        });
    }
    else {
        //失败弹框提示
        EHR.ShowBox($(result).find("returninfo").eq(0).text(), 300);
    }
}

/*选择标签事件*/
EHRLabelBox.SelectLabel = function (labelID, obj) {
    $('#txt_lbl_title').parent('div').removeClass('active');
    InboxParams['labelID'] = labelID; //标签ID
    $('#txt_lbl_title').val($(obj).text());
    $('#txt_lbl_title').css("color", "#3b3b3b");
}
/*保存标签事件*/
EHRLabelBox.SaveLabel = function () {
    //1.不是快捷标签，验证输入信息
    if (!EHRExportBox.IsFasterLabel) {
        var errTxt = "";
        //1.1验证标签必须输入
        var label = $.trim($('#txt_lbl_title').val());
        if ((label == '' || label == InboxParamsErr['deflabel'] || label + "！" == InboxParamsErr['deflabel']) && InboxParams["isResumeView"] != "1") {
            //提示错误信息
            errTxt = InboxEngine.GetErrorTip(InboxParamsErr['commonplaseinput'], InboxParamsErr['label']);
        }
        else {
            if (label + "！" == InboxParamsErr['deflabel'] || (label == InboxParamsErr['deflabel'])) label = "";
            //1.2验证标签字数
            if (EHR.getStrLength(label.replace(/\s/gi, "")) > 12) {
                //提示错误信息
                errTxt = InboxParamsErr['labelerr'];
            }
            //1.3验证标签不能含有html标签
            else if (EHR.hasHtmlTag(label)) {
                //提示错误信息
                errTxt = InboxEngine.GetErrorTip(InboxParamsErr['commoncaninputtxt'], InboxParamsErr['label']);
            }
        }
        //1.4显示错误信息
        if (errTxt != '') {
            $('#txt_lbl_title').css('border-color', '');
            $('#err_lbl_title').html(errTxt);
            $('#div_lbl_title').addClass('active');
            return;
        }
        //如果有评语，验证评语
        if (InboxParams["isResumeView"] == "1") {
            var strEvalue = $.trim($("#txt_evalue_content").val());
            if (EHR.hasHtmlTag(strEvalue)) {
                errTxt = common_hasHtmlTag.replace("{0}", blacklist_Evalue);
                $('#txt_evalue_content').css('border-color', '');
                $('#err_evalue_content').html(errTxt);
                $('#txt_evalue_content').parent().addClass('active');
                return;
            }
            InboxParams['evalueRemark'] = strEvalue;
        }
        //赋值变量
        InboxParams['labelTxt'] = label;
    }
    //2.保存标签
    //2.2标签文本
    strLabelTitle = encodeURIComponent(InboxParams['labelTxt']);
    var postData = {
        doType: 'SaveLabel', //保存标签
        strIsFilter: InboxEngine.GetIsFilter(), //是否过滤
        Seqid: InboxParams['hidSeqID'],
        UserId: InboxParams['hidUserID'],
        Folder: InboxParams['hidFolder'], //所在夹子
        LabelID: InboxParams['labelID'], //标签ID,新增为空或0
        LabelTitle: strLabelTitle,
        Remark: InboxParams['evalueRemark']    //评语
    };
    //如果标签和评语都没有填写则直接返回
    if (strLabelTitle == "" && InboxParams['evalueRemark'] == "")
        return;
    //简历批处理
    postData.isBatch = InboxEngine.isBatch;
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalInboxCommonAjax.ashx", postData, EHRLabelBox.SaveLabelResult);
}
/*删除。保存操作结果*/
EHRLabelBox.SaveLabelResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    //关闭当前弹层
    if (EHRBox.config.curBoxID)
        EHR.CloseDivBox("#" + EHRBox.config.curBoxID);
    var msgtype = $(result).find("msgtype").eq(0).text();
    var returninfo = $(result).find("returninfo").eq(0).text();
    if (msgtype == "1") {
        if (!InboxParams['isResumeView']) {
            if (!InboxEngine.isBatch) {
                // 成功则更新span
                var seqId = InboxParams['hidSeqID'].split(',');
                for (var i in seqId) {
                    //循环更新标签
                    $('span[name="LABELID_{0}"]'.format(seqId[i])).text(InboxParams['labelTxt']);
                }

                var obj = $("#divdrop_label");
                if (obj && $.trim(obj.html()) != "" && obj.find('a').length > 0) {
                    var labelid = $(result).find("labelid").eq(0).text();
                    //移除已有的标签，将其置为最上端
                    obj.find('a[tag="' + labelid + '"]').remove();
                    var tag = '<a tag="' + labelid + '" style="cursor:pointer;" title="' + InboxParams['labelTxt'] + '">' + InboxParams['labelTxt'] + '</a>';
                    //置于最上端，不包括（不限）选项
                    obj.find('a:first').after(tag);
                    obj.find('a[tag="' + labelid + '"]').click(function () { InboxEngine.SetLabel(this); });
                    //设置已选择的标签
                    var hidlabid = $('#' + prefixControlID + 'hid_label').val();
                    //如果当前是选择标签，标记颜色
                    if (hidlabid == labelid)
                        $("#divdrop_label a[tag='" + hidlabid + "']").css("color", "#ff9900");
                }
            } else {
                InboxEngine.WhileDoTask("disabled");
                //简历批处理 -
                var postdata = {
                    doType: 'BatMvHr',
                    PageFrom: $('#hidPageFrom').val(),
                    la: returninfo,
                    b: $('#hidMove').val(),
                    d: $('#hida').val()
                };
                EHR.Common_AsyncHandle("POST", "xml", "InboxResume/GlobalInboxRubAjax.ashx", postdata, EHRLabelBox.SaveLabelResultBat, 1);
            }
        }
        else {
            //当前显示的简历在操作简历之中
            var strNowUserid = "," + $("#hidSeqID").val() + ",";
            if (("," + InboxParams['hidSeqID'] + ",").indexOf(strNowUserid) >= 0) {
                if (document.getElementById("spanLabelTitle")) {
                    //先判断是否为内推简历
                    var strAddLabel = "";
                    if (InboxEngine.Option.Detail && InboxEngine.Option.IsMic)
                    //微简历详细页面
                        strAddLabel = '<span id="lbLabel" style="color: #fe5400;">' + $("#txt_lbl_title").val() + '</span><span style="width: 20px; height: 20px; cursor: pointer"><a id="deletelabela" style="display: none;" href="javascript:mk_DeleteLabel();" class="candidate-ResumeView-icon candidate-ResumeView-icon_remove_block"></a></span>';
                    else if (InboxEngine.Option.Detail)
                    //51job简历详细页面
                        strAddLabel = "<span class='delSet'>" + $("#txt_lbl_title").val() + "<a title='删除标签' class='icon icon_remove_white' href='javascript:mk_DeleteLabel(1);'></a></span>";
                    else if (InboxParams['labelTxt'] != "")
                        strAddLabel = "<span class='delSet'>" + InboxParams['labelTxt'] + "<a title='" + (lang == "en" ? "Del Tag" : "删除标签") + "' class='icon icon_remove_white' href='javascript:InboxEngine.OpenResumeCommonLayer(\"Label\",null,null,1,null,null,\"delLabel\");'></a></span>";
                    if (strAddLabel != "") {
                        $("#spanLabelTitle").html(strAddLabel);
                        $("#spanLabelTitleHead").css("display", "");
                    }
                    if (InboxParams['evalueRemark'] != "") {
                        //EHR.ShowBox(returninfo, 300, true, '$("#tabCZ2").click();', true);
                        $("#tabCZ2").click();
                        return;
                    }
                }
            }
        }
    }
    //去除标签弹框提示
    //if (!InboxEngine.isBatch) EHR.ShowBox(returninfo, 300);
}

/*简历批处理-添加标签*/
EHRLabelBox.SaveLabelResultBat = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;  
    var msgtype = $(result).find("msgtype").eq(0).text();
    var returninfo = $(result).find("returninfo").eq(0).text();
    if (msgtype == "1") {
        EHR.CloseDivBox('#div_AddLabelBoxHtml');
        EHR.ShowBox(Msg_AddLabel.replace('@', returninfo), "260", "", 'InboxEngine.taskView();',1);
        //window.location.href = "InboxTaskView.aspx?PageFrom=" + $('#hidPageFrom').val();
    } else {
         if (!returninfo) {
                    EHR.ShowBox(Msg_Err, 300);
         }else  if (returninfo == "0") {
          EHR.ShowBox(taskconfirm, 300, true, 'InboxEngine.taskContinue()', true, 'InboxEngine.closePage()');
           //EHR.ShowBox(InboxParamsErr['taskconfirm'], 300, true, 'InboxEngine.taskContinue()', true,'InboxEngine.closePage()');    
         }else{
            EHR.CloseDivBox('#div_AddLabelBoxHtml');
            EHR.ShowBox(returninfo, 300);     
         }
    }
     InboxEngine.WhileDoTask("");
   }

/*删除标签*/
   EHRLabelBox.RemoveLabel = function () {
       //wei选择数据，直接返回
       if (InboxEngine.CheckSelData()) return;
       InboxEngine.AddLog('RemoveLabel');
       if (!InboxParams['isResumeView']) {
           if (EHRMoveResumt.CanMoveResume(0))
           //确认弹层
               EHR.ShowBox(InboxParamsErr['issuredeletelabel'], "380", "", 'EHRLabelBox.RemoveLabelHandle()');
       }
       else {
           //简历详情里的删除标签只能单个操作
           InboxParams["hidSeqID"] = $("#hidSeqID").val();
           InboxParams['hidUserID'] = $("#hidUserID").val();
           EHR.ShowBox(InboxParamsErr['issuredeletelabel'], "380", "", 'EHRLabelBox.RemoveLabelHandle()');
       }
   }
/*删除标签*/
EHRLabelBox.RemoveLabelHandle = function () {
    var postData = {
        doType: 'RemoveLabel', //删除标签
        strIsFilter: InboxEngine.GetIsFilter, //是否过滤
        Seqid: InboxParams['hidSeqID'],
        UserId: InboxParams['hidUserID'],
        Folder: InboxParams['hidFolder']//所在夹子
    };
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalInboxCommonAjax.ashx", postData, EHRLabelBox.RemoveLabelResult);
}
/*删除标签结果*/
EHRLabelBox.RemoveLabelResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    //操作结果
    var msgtype = $(result).find("msgtype").eq(0).text();
    //提示文案
    var returninfo = $(result).find("returninfo").eq(0).text();
    if (msgtype == '1') {
        if (!InboxParams['isResumeView']) {
            // 成功则更新span
            var seqId = InboxParams['hidSeqID'].split(',');
            var userId = InboxParams['hidUserID'].split(',');
            for (var i in seqId) {
                if (InboxEngine.Option.LabelUpdateSpan == undefined)
                    $('span[name="LABELID_{0}"]'.format(seqId[i])).html('<div class="lx-fasterlabel-div"><a href="javascript:void(0)"  class="lx-fasterlabel-a"><i class="icon icon_add"></i></a></div>');     //更新为可以添加标签图标
                else
                    $('span[name="LABELID_{0}"]'.format(seqId[i])).html("");
                if (InboxEngine.Option.Detail == true)        //简历详情页面增加标签
                {
                    $("#spanLabelTitle").html("");
                    $("#spanLabelTitleHead").css("display", "none");
                }
            }
        }
        else {
            $("#spanLabelTitle").html("");
            $("#spanLabelTitleHead").css("display", "none");
        }       
    }
    else {
        EHR.ShowBox(returninfo, "380");
    }
}
/* 添加标签/删除标签 end*/
/********************End Add/Del Label***************/

/********************Send Message***************/
EHRSendMsgBox = {};
EHRSendMsgBox.IsFirstGet = 1;
/*发消息弹框*/
InboxEngine.SendMessage = function () {
    //InboxEngine.AddLog('SendMessage');
    //获取发送消息弹框
    EHRBox.OpenBox({ "doType": "GetSendMsgBoxHtml", "callback": EHRSendMsgBox.SetSendMessage, showBox: 0 });
    //EHRSendMsgBox.Init();
}
/*设置弹框内容*/
EHRSendMsgBox.SetSendMessage = function () {
    //设置弹框类别
    InboxEngine.MsgBoxType = "sendmsg";
    if (EHRSendMsgBox.IsFirstGet) {
        InboxEngine.SetDefParamsByHtml();
        //初始化公司、模板下拉框
        InboxEngine.InitDrop("#div_sendmsg-c,#div_sendmsg-t");
        //初始化信件内容验证
        InboxEngine.InitChangeClick();
        //绑定发送邮件
        InboxEngine.InitSendMail();
        //绑定确认按钮
        $('#a_sendmsg_s').click(function () {
            EHRSendMsgBox.SendMsg();
        });
        //绑定预览
        $('#a_sendmsg_p').click(function () {
            //验证相关参数
            if (!EHRSendMsgBox.CheckInputValid())
                return;
            InboxEngine.Preview({ pagefrom: 'sendmsg', company: encodeURIComponent(InboxParams['sel_' + InboxEngine.MsgBoxType + '-c']),
                content: encodeURIComponent($('#txt_' + InboxEngine.MsgBoxType + '_content').val())
            });
        });
        //设置默认文案

        EHRSendMsgBox.IsFirstGet = 0;
    }
    var resumeViewFolderType = document.getElementById("resumeViewFolderType");
    var msghidFolder = InboxParams['hidFolder'];
    var msghidSeqId = InboxParams['hidSeqID'];
    if (resumeViewFolderType != null && $("#hidFolder").val() == "TEMP" && resumeViewFolderType.value == "TEMP") {
        msghidFolder = "BAK";
        msghidSeqId = $("#hidSeqIDTemp").val();
    }
    postData = { doType: 'FetchBody',
        strFolder: msghidFolder,
        strIsFilter: InboxEngine.GetIsFilter(),
        UserID: InboxParams['hidUserID'],
        SeqID: msghidSeqId,
        source: InboxParams['hidSource']
    }
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalSendMaessageAjax.ashx", postData, EHRSendMsgBox.SetSendMessageResult);

}
/*设置结果*/
EHRSendMsgBox.SetSendMessageResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var msgtype = $(result).find('message').eq(0).text();
    if (msgtype == '1') {
        //1.设置参数存入变量
        InboxEngine.SetDefData(result);
        //2.设置信息主题
        var usernames = $(result).find('username').eq(0).text();
        var defsub = usernames.indexOf(',') > 0 ? "" : usernames + ",";
        $('#txt_sendmsg_sub').val(InboxParams[InboxEngine.MsgBoxType]['defsub'].replace('{0}', defsub));
        $('#txt_sendmsg_sub').css('color', '#3b3b3b');
        //清除错误样式
        InboxEngine.DelErrTip();
        //绑定是否可以发送短信
        InboxParams['cannotsendmsg'] = $(result).find('cannotsendmsg').eq(0).text();
        //3.设置默认信息
        InboxEngine.SetDefParams(result);
        EHRSendMsgBox.ChangeSendType($('#sendmsg_mail'), 0);
        //打开弹框
        EHRBox.ShowBox("#" + EHRBox.config.curBoxID);
        //设置已选择的用户姓名样式
        InboxEngine.SetSelectUserHeight();
        var sendDisplayType = $("#hidFolder");
        if (sendDisplayType != null && sendDisplayType.val() == "CUSCVWX") {
            $("#div_SendMsgBoxHtml .G_tab").eq(0).css("display", "none");
            $('#sendmsg_mobile').click();
        }
    }
    else {
        EHR.ShowBox($(result).find('returninfo').eq(0).text(), 300);
    }
}

/*更改发送方式
type:0,邮件，1：短信
*/
EHRSendMsgBox.ChangeSendType = function (obj, type) {
    //1.设置样式
    if (!$(obj).hasClass('active')) {
        $(obj).addClass('active');
    }
    $(obj).siblings('a').removeClass('active');
    //2.清除默认错误信息
    InboxParams[InboxEngine.MsgBoxType]['deferr'] = '';
    //3.可以发送短信
    if (!type) {
        //3.1发送邮件
        $('#mail_sendsmg_set,#span_sendmsg-t,#dl_sendmsg-s,#a_sendmsg_p').show();
        $('#div_sendmsg_num,#div_sendmsg_nonum').hide();
        //设置样式
        $('#div_sendmsg-t').removeClass('p_inpSize_l').addClass('p_inpSize_m');
        $('#div_sengmsg_css').removeClass('useText_bor clearfix').addClass('useText_bor clearfix');
        InboxParams['sendmobile'] = 0;
        $('#div_sendmsg_notsend').hide();
        $('#div_sendmsg_cansend').show();
        $('#a_sendmsg_p').show();
    }
    else {
        if (!InboxParams['cannotsendmsg']) {
            //3.2发送短信
            $('#mail_sendsmg_set,#span_sendmsg-t,#dl_sendmsg-s,#a_sendmsg_p').hide();
            $('#div_sendmsg_num,#div_sendmsg_nonum').show();
            //设置样式
            $('#div_sendmsg-t').removeClass('p_inpSize_m').addClass('p_inpSize_l');
            $('#div_sengmsg_css').addClass('useText_bor clearfix').removeClass('useText_bor clearfix');
            //设置类型选中
            $('#chk_sendmsg_sendmobile').attr('checked', 'checked');
            InboxParams['sendmobile'] = 1;
        }
        else {
            //4.2发送短信，提示相关信息
            $('#div_sendmsg_cansend').hide();
            $('#div_sendmsg_notsend').show();
            $('#div_sendmsg_notsend').find('span').html(InboxParams['cannotsendmsg'])
            $('#a_sendmsg_p').hide();
        }
    }

    //重新设置弹框高度
    InboxEngine.ResetDivHeight();
    //检查输入内容
    InboxEngine.CheckContentLength();
}
/*发送信息*/
EHRSendMsgBox.SendMsg = function () {

    if ($('#div_sendmsg_notsend').css('display') != 'none' && $('#sendmsg_mobile').hasClass('active')) {
        EHR.CloseDivBox("#" + EHRBox.config.curBoxID);
        return;
    }
    var strErr = "";
    //验证相关参数
    if (!EHRSendMsgBox.CheckInputValid())
        return;
    var smsCount = InboxParams['smscount'];
    var content = $("#txt_sendmsg_content").val();
    //验证短信数
    if ($("#dl_sendmsg-s").css("display") == "none") {
        //短信数不足
        if ($('#div_sendmsg_num').find('a').length > 0) {//提示信息
            $('#div_sendmsg_nonum').show().html(InboxParamsErr['msgnotenough']);
            return;
        }
    }

    if (strErr == "") {

        var strSeqid = InboxParams['seqid']; //seqid
        var strFolder = $("#hidFolder").val(); //所在夹子
        var strCoName = InboxParams['sel_sendmsg-c']; //发信公司
        var strUnames = InboxParams['username']; //选择简历姓名
        var strUserId = InboxParams['userid']; //userid
        var strCompanyID = InboxParams['sendmsg-c']; //发信公司id
        var strTemplateID = InboxParams['sendmsg-t']; //模板id
        var strReplyMail = $("#txt_sendmsg_reply").val(); //回复邮箱
        var strContent = $("#txt_sendmsg_content").val(); //信件内容
        var cvlogIds = InboxParams['cvlogids']; //cvlogids
        var strTitle = $("#txt_sendmsg_sub").val(); //信件主题
        var strReplyType = "1"; //接受回复
        var strSmsType = "1";
        if ($("#dl_sendmsg-s").css("display") == "none") {
            strSmsType = "2";  // 手机短信
        }
        else {
            strSmsType = "1";  // 站内信
            if ($('#chk_sendmsg_sendemail').attr('checked')) {
                strSmsType = "3";  // 邮件
            }
        }
        var postData = { doType: 'SaveSendMessage',
            seqid: strSeqid,
            userId: strUserId,
            coId: strCompanyID,
            templeteid: strTemplateID,
            folder: strFolder,
            smsType: strSmsType,
            isReply: strReplyType,
            replyto: strReplyMail,
            unames: encodeURIComponent(strUnames),
            coName: encodeURIComponent(strCoName),
            content: strContent,
            CvlogIds: cvlogIds,
            Title: strTitle
        }
        EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalSendMaessageAjax.ashx", postData, EHRSendMsgBox.SendMsgResult);

    }
}
//发送消息输入项验证
EHRSendMsgBox.CheckInputValid = function () {
    if (!InboxEngine.CheckSendData(1, 0, 0, 0, 0))
        return 0;
    //站内信
    var errID = "";
    if ($("#dl_sendmsg-s").css("display") != "none") {
        //验证主题
        if (!InboxEngine.CheckSendDataForSub())
            return 0;
        //验证邮箱
        if (!InboxEngine.CheckSendDataForSynEmail())
            return 0;
    }
    //验证输入内容
    if (!InboxEngine.CheckSendDataForContent()) {
        return 0;
    }
    return 1;
}
/*发送信息结果*/
EHRSendMsgBox.SendMsgResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var msgtype = $(result).find("msgtype").eq(0).text();
    var returninfo = $(result).find("returninfo").eq(0).text();
    if (msgtype == "0") {
        //失败提示
        EHR.ShowBoxTwo(returninfo, 300);
    }
    else {
        //成功关闭弹层
        if (EHRBox.config.curBoxID)
            EHR.CloseDivBox("#" + EHRBox.config.curBoxID);
        EHR.ShowBox(returninfo, 300);
    }
}
/********************End Send Message***************/

/********************Recruit***************/
/* 筛选简历 start*/
InboxEngine.Screen = function () {
    //wei选择数据，直接返回
    if (InboxEngine.CheckSelData()) return;
    InboxEngine.AddLog('Screen');
    $("#ul_recruitlist").hide();
    EHRBox.OpenBox({ "doType": "GetScreenBoxHtml", "callback": EHRScreenBox.Init });
}
var EHRScreenBox = {};
EHRScreenBox.IsFirstGet = 1;
EHRScreenBox.Init = function () {
    //设置弹框类型
    InboxEngine.MsgBoxType = 'recruit';
    if (EHRScreenBox.IsFirstGet) {
        //设置默认信息
        InboxEngine.SetDefParamsByHtml();
        //初始化信件内容验证
        InboxEngine.InitChangeClick(500);
        EHRScreenBox.IsFirstGet = 0;

        //绑定确认按钮
        $('#submit_recruit_screen').click(function () {
            EHRScreenBox.Send();
        });
    }
    $('#div_recruit_screen').find('input:first').attr('checked', 'checked');
    $('#txt_recruit_content').val('');
    InboxEngine.CheckContentLength(500);
}
/*筛选*/
EHRScreenBox.Send = function () {
    //简历评语
    var strRemark = $.trim($("#txt_recruit_content").val());
    //验证不能含有标签
    if (EHR.hasHtmlTag(strRemark)) {
        //显示错误信息
        InboxEngine.SetError('txt_recruit_content');
        $("#err_recruit_content").html(InboxEngine.GetErrorTip(InboxParamsErr['commoncaninputtxt'], InboxParamsErr['resumemark']));
        return;
    }
    //设置筛选结果
    var radioType;
    $("input[name='screen']").each(function () {
        if ($(this).attr("checked")) {
            radioType = $(this).attr("value");
            return false;
        }
    });

    var seqID = InboxParams['hidSeqID'];
    var postData = { doType: 'SaveProcFilter', seqid: seqID, userId: InboxParams['hidUserID'], folder: InboxParams['hidFolder'], radioType: radioType, strIsFilter: InboxEngine.GetIsFilter(), content: strRemark, source: InboxParams["SourceCode"], alljobids: InboxParams["hidJobID"] }
    //发送请求
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalProcFilterAjax.ashx", postData, EHRScreenBox.SendResult);
}
/*设置筛选结果*/
EHRScreenBox.SendResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var msgtype = $(result).find("msgtype").eq(0).text();
    var returninfo = $(result).find("returninfo").eq(0).text();
    if (msgtype == "1") {
        //关闭弹层
        EHRBox.CloseBox('#' + EHRBox.config.curBoxID);
        // 成功则更新span
        var seqId = InboxParams['hidSeqID'].split(',');
        var title = $(result).find('statustitle').eq(0).text();
        if (!InboxParams['isResumeView']) {
            for (var i in seqId) {
                if (InboxEngine.Option.LabelUpdateSpan == undefined)
                //设置招聘流程结果
                    $('td[id="PROCESSSTATUS_{0}"]'.format(seqId[i])).text(title);
                else
                    $('span[name="LABELID_{0}"]'.format(seqId[i])).html("");
            }
        }
        //简历详情中操作流程
        else {  
            var strNowUserid = "," + $("#hidSeqID").val() + ",";
            if (("," + InboxParams['hidSeqID'] + ",").indexOf(strNowUserid) >= 0 && title != '') {
                $("#spanProcessStatus").html(title);
                $("#spanProcessStatusHead").css("display", "");
            }
        }
        //显示弹框信息
        //EHR.ShowBox(returninfo, 300);
    }
    else {
        //显示弹框信息
        EHR.ShowBoxTwo(returninfo, 300);
    }
};
/* 筛选简历 end*/
/********************End Recruit***************/
/********************Forward*****************************/
/* 转发 start*/
InboxEngine.Forward = function () {
    //wei选择数据，直接返回
    if (InboxEngine.CheckSelData()) return;
    InboxEngine.AddLog('Forward');
    EHRBox.OpenBox({ "doType": "GetForwardBoxHtmlNew", "callback": EHRForwardBox.Init, showBox: 0 });
}
var EHRForwardBox;
if (typeof (EHRForwardBox) == undefined) {
    EHRForwardBox = {};
}
EHRForwardBox.IsFirstGet = 1;
EHRForwardBox.Init = function () {
    InboxEngine.MsgBoxType = "fwd";
    if (EHRForwardBox.IsFirstGet) {
        InboxEngine.SetDefParamsByHtml();

        //EHRExportBox.InitInputFocusBlur();
        $("input[id='txt_fwd_mailto']").focus(function () {
            //有默认文案
            $('#txt_fwd_mailto').siblings('span').html(InboxParams['deftip']);
        });
        //EHRBox.ClickHide("#" + EHRBox.config.curBoxID);
        $('#txt_fwd_mailto').siblings('a').click(function () {
            InboxEngine.FetchEmailDivData(); //绑定获取邮箱
        });
        InboxParams['deftip'] = $('#txt_fwd_mailto').siblings('span').html();

        //绑定确认按钮
        $('#submit_fwd_ok').click(function () {
            EHRForwardBox.Send();
        });
        //绑定恢复模板
        $('#a_fwd_recover').click(function () {
            InboxEngine.RecoverTemplateContent(500);
        });
        //绑定发送邮件
        InboxEngine.InitSendMail();
        //绑定预览
        //如果是从暂存夹进入的，那么隐藏转发中的预览
        var resumeViewFolderType = document.getElementById("resumeViewFolderType");
        if ((typeof (page_code) != "undefined" && page_code == '4') || (resumeViewFolderType && resumeViewFolderType.value == "TEMP" && $("#hidFolder").val() == "TEMP")) {
            $('#submit_fwd_pre').hide();
        }
        $('#submit_fwd_pre').click(function () {
            if (!EHRForwardBox.CheckInputValid())
                return;
            var strSeqId = InboxParams["hidSeqID"];
            var strFolder = InboxParams['hidFolder'];
            if (resumeViewFolderType != null && $("#hidFolder").val() == "TEMP" && resumeViewFolderType.value == "TEMP") {
                strSeqId = $("#hidSeqIdTemp").val();
                strFolder = "BAK";
            }
            InboxEngine.Preview({
                content: encodeURIComponent($('#txt_fwd_content').val()),
                mailfrom: encodeURIComponent($('#txt_fwd_mailfrom').val()),
                type: "SaveProcTransmit",
                seqid: strSeqId,
                userid: InboxParams["hidUserID"],
                folder: strFolder,
                pagefrom: 'fwd',
                filter: InboxEngine.GetIsFilter()
            });
        });
        //打开弹框  //设置输入内容检查
        InboxEngine.InitChangeClick(500);
        EHRForwardBox.IsFirstGet = 0;
    }
    EHRExportBox.GetOwnEmail('fwd');
    $('#txt_fwd_mailto').attr({ title: '', value: '' })
    $('#chk_fwd_sendemail').attr('checked', false);
    InboxEngine.DelErrTip();
    //$('#txt_fwd_sub').css('color', '#3b3b3b').val(InboxParams[InboxEngine.MsgBoxType]['defsub']);
    $('#txt_fwd_mailto').parent('div').mouseleave(function () {
        $('#div_fwd_mailtolist').hide();
    });

}

/*转发*/
EHRForwardBox.Send = function () {
    if (!EHRForwardBox.CheckInputValid())
        return;
    var resumeViewFolderType = document.getElementById("resumeViewFolderType");

    var postData = {
        doType: 'SaveProcTransmit',
        seqid: InboxParams["hidSeqID"],
        userId: InboxParams["hidUserID"],
        folder: $("#hidFolder").val(),
        strIsFilter: InboxEngine.GetIsFilter(),
        mailTo: $("#txt_fwd_mailto").val(),
        mailToHidden: $("#txt_fwd_mailto").val(),
        synCC: $("#txt_fwd_reply").val(),
        chkSynCC: $("#chk_fwd_sendemail").attr("checked") ? 1 : 0,
        content: $("#txt_fwd_content").val(),
        from: $("#txt_fwd_mailfrom").val(),
        title: $("#txt_fwd_sub").val(),
        jobid: InboxParams['hidJobID'],
        source: InboxParams['SourceCode']
    };
    var popFolderType = InboxParams['hidFolder'];
    if (popFolderType.toLowerCase() == "temp") {
        postData.doType = 'SaveProcTransmitForTemp';
    }
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalProcTransmitAjax.ashx", postData, EHRForwardBox.SendResult);
}
//验证转发输入项
EHRForwardBox.CheckInputValid = function () {
    //1.验证收件人邮箱
    if (!InboxEngine.CheckSendDataForEmail())
        return 0;
    //2验证同时抄送自己
    if (!InboxEngine.CheckSendDataForSynEmail())
        return 0;
    //3.验证发件人
    var mailfrom = $("#txt_fwd_mailfrom").val();
    //不能为空
    var obj = $('#txt_fwd_mailfrom');
    if (mailfrom.replace(/\s/gi, "").length < 1) {

        obj.css('border-color', '');
        obj.parent('div').addClass("active");
        obj.siblings('span').html(InboxEngine.GetErrorTip(InboxParamsErr['commoncannotnull'], InboxParamsErr['mailusername']));
        return 0;
    }
    //不能包含标签
    else if (EHR.hasHtmlTag(mailfrom)) {
        obj.css('border-color', '');
        obj.parent('div').addClass("active");
        obj.siblings('span').html(InboxEngine.GetErrorTip(InboxParamsErr['commoncaninputtxt'], InboxParamsErr['mailusername']));
        return 0;
    }
    //4.验证主题，不能含有标签
    if (!InboxEngine.CheckSendDataForSub())
        return 0;
    //5.验证内容--不能含有标签
    if (!InboxEngine.CheckSendDataForContent())
        return 0;
    return 1;
}
EHRForwardBox.SendResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var msgtype = $(result).find("msgtype").eq(0).text();
    var returninfo = $(result).find("returninfo").eq(0).text();
    if (msgtype == "1") {
        EHRBox.CloseBox("#" + EHRBox.config.curBoxID);
        EHR.ShowBox(returninfo, 300);
        if (InboxParams['isResumeView']) {
            var strNowUserid = "," + $("#hidSeqID").val() + ",";
            if (("," + InboxParams['hidSeqID'] + ",").indexOf(strNowUserid) >= 0) {
                var statustitle = $(result).find("statustitle").eq(0).text();
                var resumeViewFolderType = $("#resumeViewFolderType");
                if (resumeViewFolderType != null && $("#hidFolder").val() == "TEMP" && resumeViewFolderType.value == "TEMP") {
                    statustitle = "";
                }
                if (statustitle != '') {
                    $("#spanProcessStatus").html(statustitle);
                    $("#spanProcessStatusHead").css("display", "");
                }
            }
        }

    } else {
        EHR.ShowBoxTwo(returninfo, 300);
    }
}
/* 转发 end*/
/********************End Forward*****************************/

/******************** Intv***************/
InboxEngine.IntvPlan = function () {
    //wei选择数据，直接返回
    if (InboxEngine.CheckSelData()) return;
    InboxEngine.AddLog('IntvPlan');
    EHRBox.OpenBox({ "doType": "GetIntvBoxHtml", "callback": EHRIntvPlanBox.Init, "refreshback": null, showBox: 0 });
}
/*面试安排 start*/
var EHRIntvPlanBox = {};
EHRIntvPlanBox.IsFirstGet = 1;
/*初始化相关数据*/
EHRIntvPlanBox.Init = function () {
    //设置弹框类型
    InboxEngine.MsgBoxType = "intvplan";
    if (EHRIntvPlanBox.IsFirstGet) {
        InboxEngine.SetDefParamsByHtml();

        //绑定时间新增、删除
        $('#del_intvplan_time,#add_intvplan_time').click(function () {
            EHRIntvPlanBox.AddOrDelTime(this);
        });
        //绑定事件
        InboxEngine.InitBindClick();
        //绑定发送邮件
        InboxEngine.InitSendMail();
        InboxEngine.InitSendMail("chk_intvplan_tointerviewer", "txt_intvplan_mailto");
        //绑定切换通知候选人，设置状态
        $('input[name="chk_intvplan"]').click(function () {
            EHRIntvPlanBox.ChangeIntvPlanType(this);
        });
        //绑定确定按钮
        $('#submit_intvplan_ok').click(function () {
            var msg = InboxParams['smscountmsg'];
            var users = InboxParams['userid'].split(',').length;
            var num = InboxParams['smscount'];
            EHRIntvPlanBox.Send();
        });
        //绑定预览按钮
        $('#submit_intvplan_pre').click(function () {
            //验证参数
            if (!InboxEngine.CheckSendData(1, 1, 1, 1, "chk_intvplan_tointerviewer"))
                return;
            var date1 = $('#txt_intvplan_time').val();
            var date2 = $('#txt_intvplan_time2').val();
            InboxEngine.Preview({
                pagefrom: 'intvplan',
                username: encodeURIComponent(InboxParams['username']),
                content: encodeURIComponent($('#txt_intvplan_content').val()),
                date1: date1 == InboxParamsErr['plasechoose'] ? "" : date1,
                date2:$('#dl_intvplan_time').css('display')=='none'?'': date2 == InboxParamsErr['plasechoose'] ? "" : date2,
                jobname: encodeURIComponent(InboxParams['jobname']),
                company: encodeURIComponent(InboxParams['sel_' + InboxEngine.MsgBoxType + '-c'])

            });
        });
        //绑定页签qiehuan
        $('#div_IntvBoxHtml a.tab_btn').click(function () {
            EHRIntvPlanBox.ChangeType(this);
        });
        //绑定确认按钮
        $('#submit_intvresult_ok').click(function () {
            EHRIntvResultBox.Send();
        });
        //面试结果页
        $("textarea[id='txt_intvresult_content']").focus(function () {
            $('#err_intvresult_content').html(InboxParams[InboxEngine.MsgBoxType]['deferr']);
            $(this).parent('div').removeClass('active');
        });

        //4.初始化公司、模板下拉框
        InboxEngine.InitDrop('#div_intvplan-c,#div_intvplan-t');

        //绑定面试轮次
        $('#txt_intvresult_turn').change(function () {
            EHRIntvResultBox.IntvResultTurn();
        });

        //鼠标移出事件
        $('#txt_intvplan_mailto').parent('div').mouseleave(function () {
            $('#div_intvplan_mailtolist').hide();
        });

        EHRIntvPlanBox.IsFirstGet = 0;
    }

    var postData = {
        doType: 'FillInterviewDiv',
        strFolder: InboxParams['hidFolder'],
        strIsFilter: InboxEngine.GetIsFilter(),
        UserID: InboxParams['hidUserID'],
        SeqID: InboxParams['hidSeqID']
    }
    //发送请求
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalProcInterviewAjax.ashx", postData, EHRIntvPlanBox.InitResult);
    // EHRBox.ShowBox("#" + EHRBox.config.curBoxID);
}
/*初始化结果设置*/
EHRIntvPlanBox.InitResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var msgtype = $(result).find("msgtype").eq(0).text();
    var returninfo = $(result).find("returninfo").eq(0).text();
    if (msgtype != '1') {
        EHR.ShowBox(returninfo, 300);
        return;
    }
    else {
        //初始化时间控件
        var serverTime = $('#serverTime').val().split('-');
        $('#txt_intvplan_time').daterangepicker({
            singleDatePicker: true,
            timePicker: true, //是否可以选时间点
            timePickerIncrement: 30, //分钟间隔
            timePicker12Hour: false, //是否使用12小时制来显示时间,
            minDate: new Date(serverTime[0], parseInt(serverTime[1], 10) - 1, serverTime[2]),
            format: 'YYYY-MM-DD HH:mm', //日期格式,
            isShowRangText: true, //是否显示时间预览框
            isResetTime: false,
            defInputText: lang.indexOf("en") > -1 ? "Please Select" : "请选择", //输入框默认文案
            startDate: new Date(serverTime[0], parseInt(serverTime[1], 10) - 1, serverTime[2]),
            endDate: new Date('9999', '12', '31')//后期无限长
        });
        $('#txt_intvplan_time2').daterangepicker({
            singleDatePicker: true,
            timePicker: true, //是否可以选时间点
            timePickerIncrement: 30, //分钟间隔
            timePicker12Hour: false, //是否使用12小时制来显示时间,
            minDate: new Date(serverTime[0], parseInt(serverTime[1], 10) - 1, serverTime[2]),
            format: 'YYYY-MM-DD HH:mm', //日期格式,
            isShowRangText: true, //是否显示时间预览框
            isResetTime: false,
            defInputText: lang.indexOf("en") > -1 ? "Please Select" : "请选择", //输入框默认文案
            startDate: new Date(serverTime[0], parseInt(serverTime[1], 10) - 1, serverTime[2]),
            endDate: new Date('9999', '12', '31')
        });
        //1.设置参数存入变量
        InboxEngine.SetDefData(result);
        //3.设置默认信息
        InboxEngine.SetDefParams(result);
        //设置用户模板信息
        InboxEngine.SetUserTemplate(result);
        //初始化页面默认部分
        //第几轮面试
        $('#txt_intvresult_turn').val('1');
        //面试结果默认合格
        $('div.div_intvresult').find('input:first').attr('checked', 'checked');
        //面试结果内容
        $('#txt_intvresult_content').val('');
        //面试安排发送邮件
        $('#chk_intvplan_tointerviewer,#chk_intvplan_sendmobile').attr("checked", false);
        $('#chk_intvplan_sendemail,#chk_intvplan_tz').attr('checked', true);
        //面试时间
        $('#txt_intvplan_time,#txt_intvplan_time2').val(InboxParamsErr['plaseselect']).css({ color: '#b4b4b4' });
        EHRIntvPlanBox.AddOrDelTime("#del_intvplan_time");
        EHRIntvPlanBox.ChangeIntvPlanType('#chk_intvplan_tz');
        InboxEngine.DelErrTip();
        //设置显示安排还是结果页签
        var strProcessStatus = $(result).find("processstatus").eq(0).text();
        if (strProcessStatus == "") {
            strProcessStatus = "0";
        }
        if (strProcessStatus * 1 == 30) {

            EHRIntvPlanBox.ChangeType($('a#intvresult'));
        }
        else {

            EHRIntvPlanBox.ChangeType($('a#intvplan'));
        }
    }
    EHRBox.ShowBox("#" + EHRBox.config.curBoxID); //打开弹框
    InboxEngine.SetSelectUserHeight(); //设置已选择的用户姓名样式
}
/*新增删除时间*/
EHRIntvPlanBox.AddOrDelTime = function (obj) {
    var objThis = $(obj);
    var type = objThis.attr('t');
    if (type == 'add') {
        $('#dl_intvplan_time').show();
        $('#add_intvplan_time').parent().hide();
    }
    else {
        $('#dl_intvplan_time').hide();
        $('#add_intvplan_time').parent().show();
    }
}
/*切换页签*/
EHRIntvPlanBox.ChangeType = function (obj) {
    var objThis = $(obj);
    if (!objThis.hasClass('active')) {
        objThis.addClass('active');
        objThis.siblings('a').removeClass('active');
    }
    var type = objThis.attr('t');
    switch (type) {
        case '1':
            InboxEngine.MsgBoxType = "intvplan"; //设置弹框类型
            $('.div_intvresult').hide();
            $('.div_intvplan').show();
            InboxParams[InboxEngine.MsgBoxType]['deferr'] = ''; //设置默认错误信息
            if (!InboxParams['initintvplancontent']) {
                InboxParams['initintvplancontent'] = '1';
                InboxEngine.InitChangeClick(1000);
            }
            else {
                InboxEngine.CheckContentLength(1000);
            }
            break;
        case '2':
            break;
        case '3':
            $('.div_intvplan').hide();
            $('.div_intvresult').show();
            InboxEngine.MsgBoxType = "intvresult"; //设置弹框类型
            //InboxParams[InboxEngine.MsgBoxType]['deferr'] = $('#err_intvresult_content').html(); //设置默认错误信息
            if (!InboxParams['initintvresultcontent']) {
                InboxEngine.SetDefParamsByHtml();
                InboxParams['initintvresultcontent'] = '1';
                InboxEngine.InitChangeClick(500);
            }
            else {
                InboxEngine.CheckContentLength(500);
            }
            EHRIntvResultBox.IntvResultTurn(); //初始化轮次
            break;
    }
    InboxEngine.ResetDivHeight();

}
/*切换描述通知类型*/
EHRIntvPlanBox.ChangeIntvPlanType = function (obj) {
    var objThis = $(obj);
    //通知候选人
    if (objThis.attr('t') == "tz") {
        $('#div_' + InboxEngine.MsgBoxType + '_set').hide();
        $('#div_' + InboxEngine.MsgBoxType + '_tz,#submit_' + InboxEngine.MsgBoxType + '_pre').show();
    }
    else {//设置面试结果
        $('#div_' + InboxEngine.MsgBoxType + '_tz,#submit_' + InboxEngine.MsgBoxType + '_pre').hide();
        $('#div_' + InboxEngine.MsgBoxType + '_set').show();
    }
    InboxEngine.ResetDivHeight();
}

/*面试安排*/

EHRIntvPlanBox.Send = function () {
    var strErr = '';
    var chkObj = $('input[name="chk_intvplan"]:checked');
    //通知候选人验证信息
    if (chkObj.attr("t") == 'tz') {
        //验证参数
        if (!InboxEngine.CheckSendData(1, 1, 1, 1, "chk_intvplan_tointerviewer"))
            return;
        //验证发送短信数是否够
        if (InboxEngine.CheckSMGNum())
            return;
    }
    if (strErr == "") {
        //业务处理
        var strSeqid = InboxParams['hidSeqID'];
        var strUserId = InboxParams['hidUserID'];
        var strFolder = $("#hidFolder").val();
        var strUnames = InboxParams['username'];
        var strJobName = InboxParams['jobname'];

        var strSubmitType = "0";
        if ($("#chk_intvplan_tz").attr("checked") && $("#chk_intvplan_tointerviewer").attr("checked")) {
            strSubmitType = "3";
        }
        else if ($("#chk_intvplan_tointerviewer").attr("checked")) {
            strSubmitType = "2";
        }
        else if ($("#chk_intvplan_tz").attr("checked")) {
            strSubmitType = "1";
        }

        var strSendMobile = "0";
        if ($("#chk_intvplan_sendmobile").attr("checked")) {
            strSendMobile = "1";
        }

        var strReply = "1";

        var strChkEmail = "0";
        if ($('#chk_intvplan_sendemail').attr('checked')) {
            strChkEmail = "1";
        }

        var strCompanyId = InboxParams[InboxEngine.MsgBoxType + '-c'];

        var strCompanyName = InboxParams['sel_' + InboxEngine.MsgBoxType + '-c'];

        var strInterviewDate = $('#txt_intvplan_time').val();
        var strInterviewDate2 = $('#dl_intvplan_time').css('display') == "none" ? "" : $('#txt_intvplan_time2').val();

        var strMailTemplet = InboxParams[InboxEngine.MsgBoxType + '-t'];
        var strContent = $("#txt_intvplan_content").val();
        var strSendFolder = $("#txt_intvplan_reply").val();

        var strMailTo = $("#txt_intvplan_mailto").val();
        var strMailToHidden = $("#txt_intvplan_mailto").val(); //面试官eml
        var strContent2 = ""; //面试官content
        var strTitle = $("#txt_intvplan_sub").val(); //信件主题

        var strJobId = InboxParams['jobid'];
        var cvlogIds = InboxParams['cvlogids'];
        var postData = {
            seqid: strSeqid,
            folder: strFolder,
            userId: strUserId,
            unames: encodeURIComponent(strUnames),
            submittype: strSubmitType,
            JobId: strJobId,
            CvlogIds: cvlogIds,
            JobName: encodeURIComponent(strJobName),
            strIsFilter: InboxEngine.GetIsFilter(),
            source: InboxParams['SourceCode'],
            alljobids: InboxParams['hidJobID']
        };
        if (strSubmitType == "0") {
            postData.doType = "SaveInterviewed";
        } else {
            postData.doType = "SaveInterview";
            postData.coid = strCompanyId;
            postData.coname = encodeURIComponent(strCompanyName);
            postData.templeteid = strMailTemplet;
            postData.idate = strInterviewDate;
            //postData.itime = strInterviewTime;
            postData.content = strContent;
            postData.isreply = strReply;
            postData.replyto = strSendFolder;
            postData.ismobile = strSendMobile;
            postData.isemail = strChkEmail;
            postData.idate2 = strInterviewDate2;
            //postData.itime2 = strInterviewTime2;
            postData.to = strMailTo;
            postData.mailToHidden = strMailToHidden;
            postData.content2 = strContent2;
            postData.isdefcontent = "0";
            postData.Title = strTitle;
        }
        EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalProcInterviewAjax.ashx", postData, EHRIntvPlanBox.SendResult);
    }

}
/*招聘流程结果*/
EHRIntvPlanBox.SendResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var msgtype = $(result).find("msgtype").eq(0).text();
    var returninfo = $(result).find("returninfo").eq(0).text();
    if (msgtype == "1") {
        EHRBox.CloseBox('#' + EHRBox.config.curBoxID);
        // 成功则更新span
        var seqId = InboxParams['hidSeqID'].split(',');
        if (InboxEngine.MsgBoxType == "")
            seqId = $(result).find('cvlogIds_success').eq(0).text().split(',');
        var title = $(result).find('statustitle').eq(0).text();
        if (!InboxParams['isResumeView']) {
            for (var i in seqId) {
                $('td[id="PROCESSSTATUS_{0}"]'.format(seqId[i])).text(title);
            }
            switch (InboxEngine.MsgBoxType) {
                case 'intvplan':
                    if ($('#chk_intvplan_set').attr('checked'))
                        return;
                    break;
                case 'offerplan':
                    if ($('#chk_offerplan_set').attr('checked'))
                        return;
                    break;
                case 'intvresult':
                case 'offerresult':
                    return;
                default:
                    break;
            }
        }
        else {
            var strNowUserid = "," + $("#hidSeqID").val() + ",";
            if (("," + InboxParams['hidSeqID'] + ",").indexOf(strNowUserid) >= 0 && title != '') {
                $("#spanProcessStatus").html(title);
                $("#spanProcessStatusHead").css("display", "");
            }
        }
        EHR.ShowBox(returninfo, 300);
    }
    else {
        EHR.ShowBoxTwo(returninfo, 300);
    }
}
/*面试安排 end*/
/********************End Intv***************/
/********************IntvResult***************/
/*面试结果*/
EHRIntvResultBox = {}
var si_txtNum = "";
/*面试轮次设置*/
EHRIntvResultBox.IntvResultTurn = function () {

    if ($("#txt_intvresult_content").val() != "") {
        var strRemark = $("#txt_intvresult_content").val();
        if (strRemark.indexOf(si_txtNum) == 0) {
            $("#txt_intvresult_content").val(strRemark.substring(si_txtNum.length));
        }
    }
    si_txtNum = InboxEngine.GetErrorTip(InboxParamsErr['interview'], $("#txt_intvresult_turn").val()) + "：";
    $("#txt_intvresult_content").val(si_txtNum + $("#txt_intvresult_content").val());

    InboxEngine.CheckContentLength(500);

}
/*保存面试结果*/
EHRIntvResultBox.Send = function () {
    var strErr = "";

    if (EHR.hasHtmlTag($("#txt_intvresult_content").val())) {
        strErr = InboxEngine.GetErrorTip(InboxParamsErr['commoncaninputtxt'], InboxParamsErr['resumemark']);
    }
    if (strErr != '') {
        var obj = $('#txt_intvresult_content');
        //InboxEngine.SetErrTip(obj, strErr);
        obj.css('border-color', '');
        obj.parent('div').addClass('active');
        $('#err_intvresult_content').html(strErr);
        return;
    }
    if (strErr == "") {
        var strSeqid = InboxParams['hidSeqID'];
        var strUserId = InboxParams['hidUserID'];
        var strFolder = $("#hidFolder").val();
        var strUnames = InboxParams['username'];
        var strJobName = InboxParams['jobname']; // $("#si_hidJobName").val();
        var strResultType = "";
        strResultType = $("input[name='intvresult']:checked").val();

        var strNum = $("#txt_intvresult_turn").val();
        var strRemark = $("#txt_intvresult_content").val();


        var cvlogIds = InboxParams['cvlogids'];

        var postData = {
            doType: "SaveInterviewResult",
            seqid: strSeqid,
            userId: strUserId,
            folder: strFolder,
            unames: strUnames,
            radioType: strResultType,
            Num: strNum,
            content: strRemark,
            JobName: strJobName,
            strIsFilter: InboxEngine.GetIsFilter(),
            CvlogIds: cvlogIds
        };
        EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalProcInterviewAjax.ashx", postData, EHRIntvPlanBox.SendResult);


    }
}
/*面试结果 end*/
/********************End IntvResult***************/
/********************RSM***************/
/*测评*/
/*1.获取测评弹框*/
InboxEngine.Rms = function () {
    //wei选择数据，直接返回
    if (InboxEngine.CheckSelData()) return;
    InboxEngine.AddLog('Rms');
    $("#ul_recruitlist").hide();
    EHRBox.OpenBox({ "doType": "GetRmsBoxHtml", "callback": EHRRsmBox.Init, "refreshback": null, showBox: 0 });
}
EHRRsmBox = {};
EHRRsmBox.IsFirstGet = 1;
/*2.初始化测评弹框数据*/
EHRRsmBox.Init = function () {
    InboxEngine.MsgBoxType = "rsm";
    if (EHRRsmBox.IsFirstGet) {
        InboxEngine.SetDefParamsByHtml();

        //$('#txt_rsm_time').val();
        InboxEngine.InitBindClick();
        //绑定发送邮件
        InboxEngine.InitSendMail();
        //绑定确定按钮
        $('#submit_rsm_ok').click(function () {
            EHRRsmBox.Send();
        });
        //绑定预览按钮
        $('#submit_rsm_pre').click(function () {
            if (!EHRRsmBox.CheckInputValid())
                return;
            var date1 = $('#txt_rsm_time').val();
            InboxEngine.Preview({
                pagefrom: 'rsm',
                username: encodeURIComponent(InboxParams['username']),
                content: encodeURIComponent($('#txt_rsm_content').val()),
                date1: date1 == InboxParamsErr['plasechoose'] ? "" : date1,
                jobname: encodeURIComponent(InboxParams['jobname']),
                company: InboxParams['hidSeqID'],
                testid: InboxParams['rsm-c']

            });
        });
        InboxEngine.InitDrop('#div_rsm-c'); //初始化下拉框
        InboxEngine.InitChangeClick(500); //初始化输入字数检查
        EHRRsmBox.IsFirstGet = 0;
    }
    var postData = {
        doType: 'FillEvaluateDiv',
        folder: InboxParams['hidFolder'],
        isFilter: InboxEngine.GetIsFilter(),
        userIds: InboxParams['hidUserID'],
        seqIds: InboxParams['hidSeqID']
    }
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalEvaluateAjax.ashx", postData, EHRRsmBox.InitResult);
}
/*2.1初始化测评弹框数据*/
EHRRsmBox.InitResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var msgtype = $(result).find("msgtype").eq(0).text();
    //var returninfo = $(result).find("returninfo").eq(0).text();
    if (msgtype == '1') {
        var serverTime = $('#serverTime').val().split('-');
        $('#txt_rsm_time').daterangepicker({
            minDate: moment().subtract('days', 1),
            maxDate: moment().add('days', 60),
            isResetTime: false,
            defInputText: lang.indexOf("en") > -1 ? "Please Select" : "请选择", //输入框默认文案
            startDate: new Date(serverTime[0], parseInt(serverTime[1], 10) - 1, serverTime[2]),
            //clearButtonDisplay: false,
            format: 'YYYY-MM-DD' //日期格式
        });
        //测评内容
        var defrsmType = $(result).find("defrsmtype").eq(0).text();
        var defrsmName = $(result).find("defrsmname").eq(0).text();
        var rsmList = $(result).find("evoptions").eq(0).text();
        $('#div_rsm-c').find('div.gdownList').remove();
        $('#div_rsm-c').find('input').after(rsmList);
        //已选简历
        var seluserNames = $(result).find('selusername').eq(0).text();
        $('#rsm_resume_selected').html(seluserNames);
        if (defrsmType) {
            InboxParams['rsm-c'] = defrsmType;
            InboxParams['sel_rsm-c'] = defrsmName;

            $('#div_rsm-c').find('input').css("color", "#3b3b3b").val(defrsmName);
        }
        $('#txt_rsm_reply').css('color', '#3b3b3b').val($(result).find("defuseremail").eq(0).text());
        InboxParams['rsm_num'] = $(result).find("defnum").eq(0).text(); //测评邀请剩余数
        InboxParams['rsm_enough'] = $(result).find("defisenough").eq(0).text(); //测评邀请数是否足够
        InboxParams['rsmcountmsg'] = $(result).find("rsmcountmsg").eq(0).text(); //测评邀请数提示语
        InboxParams['rsmkey'] = $(result).find("key").eq(0).text();
        InboxParams['servertime'] = $(result).find("servertime").eq(0).text(); //服务器时间
        InboxEngine.SetDefParams(result); //设置参数
        EHRRsmBox.SetRsmNum(result); //设置邀请数提示语
        //初始化时间控件
        $('#txt_rsm_time').val(InboxParamsErr['plaseselect']).css({ color: '#b4b4b4' });
        //初始化页面默认部分
        //面试安排发送邮件
        $('#chk_rsm_sendmobile').attr("checked", false);
        //短信数提示语
        $('#div_' + InboxEngine.MsgBoxType + '_num,#div_' + InboxEngine.MsgBoxType + '_nonum').css('display', 'none');
        InboxEngine.DelErrTip();
        InboxEngine.SetUserTemplate(result);
        InboxEngine.CheckContentLength(500);
        EHRBox.ShowBox("#" + EHRBox.config.curBoxID);
        InboxEngine.SetSelectUserHeight();
    }
    else {

        EHR.ShowBox($(result).find("returninfo").eq(0).text(), 300);
    }

}
/*测评邀请*/
EHRRsmBox.Send = function () {

    if (!EHRRsmBox.CheckInputValid())
        return;
    //短信不足、licence不足弹出报错层
    if (!InboxParams['rsm_enough']) {
        EHR.ShowBoxTwo(InboxParamsErr['rsmnotenough'], 300);
        return false;
    }

    if (InboxEngine.CheckSMGNum())
        return;
    //本地扣数提示弹层
    var strDeductTips = "";
    strDeductTips += $('#div_rsm_rsmnum').find('span').text();
    if ($("#chk_rsm_sendmobile").attr("checked"))
        strDeductTips += "</br>" + $('#div_rsm_num').text();

    strDeductTips += "</br>" + InboxParamsErr['issuresend'];

    EHR.ShowBoxTwo(strDeductTips, 500, 1, 'EHRRsmBox.SendRsm();');
}
//验证测评输入项
EHRRsmBox.CheckInputValid = function () {
    var strErr = "";
    if (!InboxParams[InboxEngine.MsgBoxType + '-c']) {
        EHR.ShowBoxTwo(InboxParamsErr['rsmnobuy'], 300);
        return 0;
    }

    var T1 = $("#txt_rsm_time").val(); //生效开始日期
    if (T1 == "" || T1 == InboxParamsErr['plasechoose']) {
        strErr = InboxParamsErr['plasechoosetime'];
        InboxEngine.SetErrTip($('#txt_rsm_time'), strErr);
        return 0;
    }
    else {
        var t = T1.split(' - ');
        InboxParams['T1'] = t[0];
        InboxParams['T2'] = t[1];
        if (InboxParams['T1'] == InboxParams['T2']) {
            strErr = InboxParamsErr['starttimenotlessthanendtime'];
            InboxEngine.SetErrTip($('#txt_rsm_time'), strErr);
            return 0;
        }
    }
    if (!InboxEngine.CheckSendDataForSub())
        return 0;
    if (!InboxEngine.CheckSendDataForContent())
        return 0;
    if (!InboxEngine.CheckSendDataForSynEmail())
        return 0;
    return 1;
}
EHRRsmBox.SendRsm = function () {
    //验证选中的简历是否存在已发送过邀请的。
    var strCvlogIds = InboxParams['cvlogids'];
    var strUserIds = InboxParams['userid'];
    var strSeqIds = InboxParams['seqid'];
    var strContent = $("#txt_rsm_content").val();            //信件内容
    //strContent = escape(encodeURIComponent(strContent));
    var strFolder = $("#hidFolder").val();
    var strSendMsg = "0"; //是否发送短信
    if ($("#chk_rsm_sendmobile").attr("checked")) {
        strSendMsg = "1";

    }
    var postData = { doType: 'SaveEvaluateInfo',
        folder: strFolder,
        cvlogIds: strCvlogIds,
        userIds: strUserIds,
        key: InboxParams['rsmkey'],
        serverTime: InboxParams['servertime'],
        invitateDateTime1: InboxParams['T1'],
        invitateDateTime2: InboxParams['T2'],
        mailContent: strContent,
        emailAddr: $('#txt_rsm_reply').val(),
        testType: InboxParams['rsm-c'],
        testContent: InboxParams['sel_rsm-c'],
        sendMsg: strSendMsg,
        source: InboxParams['SourceCode'],
        strIsFilter:$("#hidIsFilter").val()
    };

    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalEvaluateAjax.ashx", postData, EHRRsmBox.SendRsmResult);
}
/*提交测评邀请结果*/
EHRRsmBox.SendRsmResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var msgtype = $(result).find("msgtype").eq(0).text();
    var returninfo = $(result).find("returninfo").eq(0).text();

    if (msgtype == "1") {
        if ($(result).find("retstatus").eq(0).text() == "1") {
            EHRBox.CloseBox('#' + EHRBox.config.curBoxID);
            EHRIntvPlanBox.SendResult(result);
        }
        else {

            EHR.ShowBoxTwo(returninfo, 300);
        }
    }
    else {

        EHR.ShowBoxTwo(returninfo, 300);
    }
}
/*设置测评数*/
EHRRsmBox.SetRsmNum = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var num = $(result).find('defnum').eq(0).text(); //剩余测评邀请数
    var rsmTip = InboxParams['rsmcountmsg']; //剩余邀请数提示语
    var userNum = InboxParams['username'].split(',').length; //邀请人数=扣除的邀请数
    if (userNum > num) {
        InboxParams['rsm_enough'] = 0;
        rsmTip += "<a href='/CommonPage/ProductPurchase.aspx?Type=RMS' target='_blank' style='color:#0066cc;cursor:pointer;text-decoration:underline;font-size:12px;'>" + InboxParamsErr['contactbuy'] + "</a>";
    }
    else
        InboxParams['rsm_enough'] = 1;
    $('#div_rsm_rsmnum').html(rsmTip.replace("{0}", userNum).replace("{1}", num));
}
EHRRsmBox.GetRsmNum = function () {
    var postData = { doType: 'ChangeSelectedAssessment',
        testType: InboxParams[InboxEngine.MsgBoxType + '-c']
    };
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalEvaluateAjax.ashx", postData, EHRRsmBox.SetRsmNum);
}
//处理查看测评报告
EHRRsmBox.procEvaluateReport = function (ctmid, hruid, testStatus, cvlogId, key, serverTime, obj) {
    var rand = Math.random();
    if (serverTime != "" && key != "" && cvlogId != "") {
        $(obj).attr({ 'href': "../RMS/EvaluateDownload.aspx?ctmid=" + ctmid + "&hruid=" + hruid + "&ts=" + testStatus + "&id=" + cvlogId + "&st=" + serverTime + "&key=" + key + "&ut=&rand=" + rand, "target": "_blank" });
        //window.open("../RMS/EvaluateDownload.aspx?ctmid=" + ctmid + "&hruid=" + hruid + "&ts=" + testStatus + "&id=" + cvlogId + "&st=" + serverTime + "&key=" + key + "&ut=&rand=" + rand, "_blank", "scrollbars=yes,Width=500px,Height=450px,resizable=yes");
    }
}

/********************End RSM***************/

/******************** Offer***************/
/*录用*/
InboxEngine.Offer = function () {
    //wei选择数据，直接返回
    if (InboxEngine.CheckSelData()) return;
    InboxEngine.AddLog('Offer');
    $("#ul_recruitlist").hide();
    EHRBox.OpenBox({ "doType": "GetOfferBoxHtml", "callback": EHROfferPlanBox.Init, "refreshback": null, showBox: 0 });
}
EHROfferPlanBox = {};
EHROfferPlanBox.IsFirstGet = 1;
/*初始化相关数据*/
EHROfferPlanBox.Init = function () {
    InboxEngine.MsgBoxType = "offerplan";
    if (EHROfferPlanBox.IsFirstGet) {
        InboxEngine.SetDefParamsByHtml();

        InboxEngine.InitBindClick();
        //绑定发送邮件
        InboxEngine.InitSendMail();
        InboxEngine.InitSendMail("chk_offerplan_tohr", "txt_offerplan_mailto");
        //绑定页签qiehuan
        $('#div_OfferBoxHtml a.tab_btn').click(function () {
            EHROfferPlanBox.ChangeType(this);
        });
        //绑定切换通知候选人，设置状态
        $('input[name="chk_offerplan"]').click(function () {
            EHRIntvPlanBox.ChangeIntvPlanType(this);
        });
        //绑定确定按钮
        $('#submit_offerplan_ok').click(function () {
            EHROfferPlanBox.Send();
        });
        //绑定预览按钮
        $('#submit_offerplan_pre').click(function () {
            if (!InboxEngine.CheckSendData(1, 1, 1, 1, "chk_offerplan_tohr"))
                return;
            var date1 = $('#txt_offerplan_time').val();
            InboxEngine.Preview({
                pagefrom: 'offerplan',
                username: encodeURIComponent(InboxParams['username']),
                content: encodeURIComponent($('#txt_offerplan_content').val()),
                date1: date1 == InboxParamsErr['plasechoose'] ? "" : date1,
                jobname: encodeURIComponent(InboxParams['jobname']),
                company: encodeURIComponent(InboxParams['sel_' + InboxEngine.MsgBoxType + '-c'])

            });
        });
        $('#submit_offerresult_ok').click(function () {
            EHROfferResultBox.Send();
        });
        //录用结果页
        $("textarea[id='txt_offerresult_content']").focus(function () {
            $('#err_offerresult_content').html(InboxParams[InboxEngine.MsgBoxType]['deferr']);
            $(this).parent('div').removeClass('active');
        });

        //鼠标移出事件
        $('#txt_offerplan_mailto').parent('div').mouseleave(function () {
            $('#div_offerplan_mailtolist').hide();
        });
        InboxEngine.InitDrop('#div_offerplan-c,#div_offerplan-t');
        EHROfferPlanBox.IsFirstGet = 0;
    }
    var postData = {
        doType: 'FillProcHireDiv',
        strFolder: InboxParams['hidFolder'],
        strIsFilter: InboxEngine.GetIsFilter(),
        UserID: InboxParams['hidUserID'],
        SeqID: InboxParams['hidSeqID']
    }
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalProcHireAjax.ashx", postData, EHROfferPlanBox.InitResult);

}
EHROfferPlanBox.InitResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var msgtype = $(result).find("msgtype").eq(0).text();
    var returninfo = $(result).find("returninfo").eq(0).text();
    if (msgtype != '1') {
        EHR.ShowBox(returninfo, 300);
    }
    else {
        var serverTime = $('#serverTime').val().split('-');
        $('#txt_offerplan_time').daterangepicker({
            singleDatePicker: true,
            timePicker: true, //是否可以选时间点
            timePickerIncrement: 30, //分钟间隔
            timePicker12Hour: false, //是否使用12小时制来显示时间,
            minDate: new Date(serverTime[0], parseInt(serverTime[1], 10) - 1, serverTime[2]),
            format: 'YYYY-MM-DD HH:mm', //日期格式,
            isShowRangText: true, //是否显示时间预览框
            isResetTime: false,
            defInputText: lang.indexOf("en") > -1 ? "Please Select" : "请选择", //输入框默认文案
            startDate: new Date(serverTime[0], parseInt(serverTime[1], 10) - 1, serverTime[2]),
            endDate: new Date('9999', '12', '31')//后期无限长
        });
        InboxEngine.SetDefData(result);
        InboxEngine.SetDefParams(result);

        InboxEngine.SetUserTemplate(result);
        //初始化页面默认部分
        //录用结果默认合格
        $('div.div_offerresult').find('input:first').attr('checked', 'checked');
        //录用结果内容
        $('#txt_offerresult_content').val('');
        //录用安排发送邮件
        $('#chk_offerplan_tohr,#chk_offerplan_sendmobile').attr("checked", false);
        $('#chk_offerplan_sendemail,#chk_offerplan_tz').attr('checked', true);
        //录用时间
        $('#txt_offerplan_time').val(InboxParamsErr['plaseselect']).css({ color: '#b4b4b4' });
        EHRIntvPlanBox.ChangeIntvPlanType('#chk_offerplan_tz');
        InboxEngine.DelErrTip();
        var strProcessStatus = $(result).find("processstatus").eq(0).text();
        if (strProcessStatus == "") {
            strProcessStatus = "0";
        }
        if (strProcessStatus * 1 == 40) {
            EHROfferPlanBox.ChangeType($('a#offerresult'));
        }
        else {

            EHROfferPlanBox.ChangeType($('a#offerplan'));
        }
        EHRBox.ShowBox("#" + EHRBox.config.curBoxID);
        InboxEngine.SetSelectUserHeight();
    }
}

/*录用安排*/
EHROfferPlanBox.Send = function () {

    var strErr = "";
    if ($('#chk_offerplan_tz').attr("checked")) {

        if (!InboxEngine.CheckSendData(1, 1, 1, 1, "chk_offerplan_tohr"))
            return;
        if (InboxEngine.CheckSMGNum())
            return;
    }
    if (strErr == "") {
        //业务处理
        var strSeqid = InboxParams['hidSeqID'];
        var strUserId = InboxParams['hidUserID'];
        var strFolder = $("#hidFolder").val();
        var strUnames = InboxParams['username'];
        var strJobName = InboxParams['jobname'];

        var strSubmitType = "0";
        if ($("#chk_offerplan_tz").attr("checked") && $("#chk_offerplan_tohr").attr("checked")) {
            strSubmitType = "3";
        }
        else if ($("#chk_offerplan_tohr").attr("checked")) {
            strSubmitType = "2";
        }
        else if ($("#chk_offerplan_tz").attr("checked")) {
            strSubmitType = "1";
        }

        var strSendMobile = "0";
        if ($("#chk_offerplan_sendmobile").attr("checked")) {
            strSendMobile = "1";
        }

        var strReply = "1";

        var strCompanyId = InboxParams[InboxEngine.MsgBoxType + '-c'];
        var strCompanyName = InboxParams['sel_' + InboxEngine.MsgBoxType + '-c'];

        var strInterviewDate = $("#txt_offerplan_time").val();
        var strInterviewTime = $("#se_sltInterviewTime").val();
        var strMailTemplet = InboxParams[InboxEngine.MsgBoxType + '-t'];
        var strContent = $("#txt_offerplan_content").val();
        var strChkEmail = "0";
        if (document.getElementById("chk_offerplan_sendemail").checked) {
            strChkEmail = "1";
        }
        var strSendFolder = $("#txt_offerplan_reply").val();

        //var strInterviewDate2 = $("#se_txtInterviewDate2").val();
        //var strInterviewTime2 = $("#se_sltInterviewTime2").val();
        var strMailTo = $("#txt_offerplan_mailto").val();
        var strMailToHidden = $("#txt_offerplan_mailto").val();
        var strContent2 = "";
        var strJobId = InboxParams['jobid'];
        var cvlogIds = InboxParams['cvlogids'];
        var strTitle = $("#txt_offerplan_sub").val();

        strJobName = encodeURIComponent(strJobName);
        strUnames = encodeURIComponent(strUnames);
        strCompanyName = encodeURIComponent(strCompanyName);
        strContent = encodeURIComponent(strContent);
        strContent2 = encodeURIComponent(strContent2);
        strMailToHidden = encodeURIComponent(strMailToHidden);

        var postData = '';
        if (strSubmitType == "0") {
            postData = {
                doType: 'SaveEmployed',
                seqid: strSeqid,
                folder: strFolder,
                userId: strUserId,
                unames: strUnames,
                submittype: strSubmitType,
                strIsFilter: InboxEngine.GetIsFilter(),
                JobName: strJobName,
                JobId: strJobId,
                CvlogIds: cvlogIds
            }
        }
        else {
            postData = {
                doType: 'SaveProcHire',
                seqid: strSeqid,
                folder: strFolder,
                userId: strUserId,
                unames: strUnames,
                coid: strCompanyId,
                coname: strCompanyName,
                submittype: strSubmitType,
                templeteid: strMailTemplet,
                idate: strInterviewDate,
                //itime:strInterviewTime,

                content: strContent,
                isreply: strReply,
                replyto: strSendFolder,
                ismobile: strSendMobile,
                isemail: strChkEmail,
                //                idate2: strInterviewDate,
                //                itime2: strInterviewTime,
                JobName: strJobName,
                strIsFilter: InboxEngine.GetIsFilter(),
                to: strMailTo,
                mailToHidden: strMailToHidden,
                content2: strContent2,
                isdefcontent: "",
                JobId: strJobId,
                CvlogIds: cvlogIds,
                Title: encodeURIComponent(strTitle)
            }
        }
        EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalProcHireAjax.ashx", postData, EHRIntvPlanBox.SendResult);

    }

}
EHROfferPlanBox.SendResult = function () {

}
/*切换页签*/
EHROfferPlanBox.ChangeType = function (obj) {
    var objThis = $(obj);
    if (!objThis.hasClass('active')) {
        objThis.addClass('active');
        objThis.siblings('a').removeClass('active');
    }
    var type = objThis.attr('t');
    switch (type) {
        case '1':
            InboxEngine.MsgBoxType = "offerplan";
            $('.div_offerresult').hide();
            $('.div_offerplan').show();
            InboxParams[InboxEngine.MsgBoxType]['deferr'] = '';
            if (!InboxParams['initofferplancontent']) {
                InboxEngine.InitChangeClick(1000);
                InboxParams['initofferplancontent'] = '1';
            }
            else {
                InboxEngine.CheckContentLength(1000);
            }
            break;
        case '2':
        case '3':
            $('.div_offerplan').hide();
            $('.div_offerresult').show();
            InboxEngine.MsgBoxType = "offerresult";
            if (!InboxParams['initofferresultcontent']) {
                InboxEngine.SetDefParamsByHtml();
                InboxEngine.InitChangeClick(500);
                InboxParams['initofferresultcontent'] = '1';
            }
            else {
                InboxEngine.CheckContentLength(500);
            }
            break;
    }
    InboxEngine.ResetDivHeight();

}
/**录用结果*/
EHROfferResultBox = {}
EHROfferResultBox.Send = function () {

    if (!InboxEngine.CheckSendDataForContent(1))
        return;
    if (strErr == "") {
        var strSeqid = InboxParams['hidSeqID'];
        var strUserId = InboxParams['hidUserID'];
        var strFolder = $("#hidFolder").val();
        var strUnames = InboxParams['username'];
        var strJobName = InboxParams['jobname']; // $("#si_hidJobName").val();
        var strRemark = $("#txt_offerresult_content").val();
        var cvlogIds = InboxParams["cvlogids"];
        var strResultType = "";
        strResultType = $("input[name='offerresult']:checked").val();

        strJobName = encodeURIComponent(strJobName);
        strUnames = encodeURIComponent(strUnames);
        strRemark = encodeURIComponent(strRemark);

        var postData = {
            doType: "SaveProcHireResult",
            seqid: strSeqid,
            userId: strUserId,
            folder: strFolder,
            unames: strUnames,
            radioType: strResultType,
            content: strRemark,
            JobName: strJobName,
            strIsFilter: InboxEngine.GetIsFilter(),
            CvlogIds: cvlogIds
        };
        EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalProcHireAjax.ashx", postData, EHRIntvPlanBox.SendResult);


    }
}
/*保存录用结果*/
EHROfferResultBox.SaveOfferResult = function () {
    if (InboxEngine.IsReloginTip(result)) return;
    var msgtype = $(result).find("msgtype").eq(0).text();
    var returninfo = $(result).find("returninfo").eq(0).text();
    if (msgtype == "1") {
        EHRBox.CloseBox('#' + EHRBox.config.curBoxID);
        // 成功则更新span
        var seqId = InboxParams['hidSeqID'].split(',');
        var title = $(result).find('statustitle').eq(0).text();
        for (var i in seqId) {
            $('td[id="PROCESSSTATUS_{0}"]'.format(seqId[i])).text(title);
        }
        //EHR.ShowBox(returninfo);
        EHR.ShowBox(returninfo, 300);
    }
    else {
        EHR.ShowBoxTwo(returninfo, 300);
    }

}
/********************End Offer***************/

/********************Start DelResume***************/
/* 删除简历 start*/
InboxEngine.DelResume = {
    show: function () {
        InboxEngine.GetSelectedValue('chkBox', "value1", "hidSeqID", 1);
        if (InboxParams['hidSeqID'] == '') {
            EHR.ShowBox(Msg_SelectResume, 300);
            return false;
        }
        EHR.ShowBox(InboxParamsErr['delconfirm'], 300, true, 'InboxEngine.DelResume.del(' + InboxParams['hidSeqID '] + ');', true);
    },

    del: function () {
        InboxEngine.GetSelectedValue('chkBox', "value1", "hidSeqID", 1);
        var postdata = {
            doType: 'DelRusume',
            a: InboxParams['hidSeqID']
        }
        EHR.Common_AsyncHandle("POST", "xml", "InboxResume/GlobalInboxRubAjax.ashx", postdata, InboxEngine.DelResume.SuccHandler);
    },
    SuccHandler: function (result) {
        if (InboxEngine.IsReloginTip(result)) return;
        var msgtype = $(result).find("msgtype").eq(0).text();
        var returninfo = $(result).find("returninfo").eq(0).text();
        if (!InboxEngine.isBatch) {
            if (msgtype == "1") {
                $('#hidSortDirection').val(($('#hidSortDirection').val() == "ASC") ? "DESC" : "ASC");
                $("#btnSort")[0].click();
            } else {
                EHR.ShowBox(InboxParamsErr['delerr']);
            }
        }
    }
}
/* 删除简历 end*/
/********************End DelResume***************/

/********************Start MoveHR***************/
/* 放入人才夹 start*/
InboxEngine.MoveHR = {
    show: function (aut) {
        //权限不足，直接退出
        if (!aut) {
            EHR.ShowBox(movehrWarning, 356);
            //EHR.ShowBox(InboxParamsErr['movehrWarning'], 356);
            return false;
        }
        //EHR.ShowBox(InboxParamsErr['movehrConfirm'], 300, true, 'InboxEngine.MoveHR.move();', true);
        EHR.ShowBox(movehrConfirm, 300, true, 'InboxEngine.MoveHR.move();', true);
        //InboxEngine.AddLog('MoveToHR');
    },
    move: function () {
        if (!InboxEngine.isBatch) {
            InboxEngine.GetSelectedValue("chkBox", "value", "hidUserID");
            InboxEngine.GetSelectedValue('chkBox', "value1", "hidSeqID");
            if (InboxParams['hidUserID'] == "") return;
            var postdata = {
                doType: 'MoveHr',
                a: InboxParams['hidSeqID']
            }
        } else {
            InboxEngine.WhileDoTask("disabled"); 
            var postdata = {
                doType: 'BatMvHr',
                PageFrom: $('#hidPageFrom').val(),
                b: $('#hidMove').val(),
                d: $('#hida').val()
            }
        }
        EHR.Common_AsyncHandle("POST", "xml", "InboxResume/GlobalInboxRubAjax.ashx", postdata, InboxEngine.MoveHR.SuccHandler,1);
    },
    SuccHandler: function (result) {
        if (InboxEngine.IsReloginTip(result)) return;
        var msgtype = $(result).find("msgtype").eq(0).text();
        var returninfo = $(result).find("returninfo").eq(0).text();
        if (!InboxEngine.isBatch) {
            if (msgtype == "1") {
                $('#hidSortDirection').val(($('#hidSortDirection').val() == "ASC") ? "DESC" : "ASC");
                $("#btnSort")[0].click();
            } else {
                EHR.ShowBox(movehrerr);
                //EHR.ShowBox(InboxParamsErr['movehrerr']);
            }
        } else {
            if (msgtype == "1") {
                 EHR.ShowBox(Msg_MoveHr.replace('@',returninfo), "278", "", 'InboxEngine.taskView();',1);
               // window.location.href = "InboxTaskView.aspx?PageFrom=" + $('#hidPageFrom').val();
            } else {
                  if (!returninfo) {
                    EHR.ShowBox(Msg_Err, 300);
                }else if (returninfo == "0") {
                    EHR.ShowBox(taskconfirm, 300, true, 'InboxEngine.taskContinue()', true, 'InboxEngine.closePage()');
                //EHR.ShowBox(InboxParamsErr['taskconfirm'], 300, true, 'InboxEngine.taskContinue()', true,'InboxEngine.closePage()');       
                }else{
                    EHR.ShowBox(returninfo, 300);
                }
            }
            InboxEngine.WhileDoTask(""); 
        }
    }
}
/* 放入人才夹 end*/
/********************End MoveHR***************/

/* 举报/黑名单 begin*/
EHRBlackList={};
EHRBlackList.PopupBlackList = function(){
    EHRBox.OpenBox({ "doType": "GetBlackListHtml", "callback": EHRBlackList.Init });
}
EHRBlackList.Init = function () {
    InboxEngine.MsgBoxType = "blacklist";
    $('input[name="bl_reason"][type="radio"]').each(function () {
        $(this).attr('checked', false);
    });
    $("#blCheckAlert").hide();
    $('input[id="bl_chkBlacklist"][type="checkbox"]').attr('checked', false);
    $("#bl_txtRemark").val("");
    $("#bl_txtFilter_Contact").val("");
    $("#bl_txtFilter_Tel").val("");
    var contentLimit = $("#bl_txtRemark_limit").html();
    $("#bl_txtRemark_limit").html(contentLimit.replace('{0}', 0).replace('{1}', 200));
    EHRBlackList.HideErro("bl_txtRemark");
    EHRBlackList.HideErro("bl_txtFilter_Contact");
    EHRBlackList.HideErro("bl_txtFilter_Tel");
    EHRBlackList.HideErro("bl_txtFilter_Email");
    EHRBlackList.HideErro("bl_chkBlacklist");
    $("[id='bl_txtRemark']").live('paste keyup mouseup blur', function () {
        EHRBlackList.CheckContentLength(200, this);
    });
    $("[id='bl_chkBlacklist']").live('click', function () {
        if ($("#bl_chkBlacklist").attr("checked"))
            $("#blCheckAlert").show();
        else
            $("#blCheckAlert").hide();
    });
    var strPostdata = "doType=FetchFilterCount";
    $.ajax(
        {
            type: "POST",
            async: true,
            dataType: 'xml',
            url: "../ajax/InboxResume/GlobalBlacklistAjax.ashx",
            data: strPostdata,
            success: function (result) {
                var ret = $(result).find("returninfo").eq(0).text();
                var stremail = $(result).find("email").eq(0).text();
                $("#bl_txtFilter_Email").val(stremail);
                if (ret == "") {
                    var count = 0;
                    try {
                        count = parseInt($(result).find("count").eq(0).text());
                    }
                    catch (ex) { }
                    var returninfo = $(result).find("message").eq(0).text();

                    if (count >= 40) {
                        $("#bl_chkBlacklist").attr("disabled", "disabled");
                    }
                    else {
                        $("#bl_chkBlacklist").removeAttr("disabled");
                    }
                    $("#lbBlacklist").html(returninfo);
                }
                else {
                    $("#err_bl_chkBlacklist").html(ret);
                }
            },
            complete: function (XMLHttpRequest, textStatus) {
            }
        });
}
    EHRBlackList.ShowErro = function (field, content) {
        if ($("#err_" + field)) {
            $("#err_" + field).html(content);
            $("#err_" + field).show();
            $("#err_" + field).parent().addClass("active");
        }
    }
    EHRBlackList.HideErro = function (field) {
        if ($("#err_" + field)) {
            $("#err_" + field).hide();
            $("#err_" + field).parent().removeClass("active");
        }
    }
    EHRBlackList.Save = function () {
        var strErr = "";
        if (document.getElementById("rdoReason9").checked) {

            if ($("#bl_txtRemark").val().replace(/\s/gi, "").length < 1) {
                strErr = selectOtherReason;
                InboxEngine.SetErrTip($('#bl_txtRemark'), strErr);
                return;
            }

            if (EHR.hasHtmlTag($("#bl_txtRemark").val())) {
                strErr = common_hasHtmlTag.replace("{0}", blacklist_Reason);
                InboxEngine.SetErrTip($('#bl_txtRemark'), strErr);
                return;
            }
        }
        //用户信息验证
        var adviceEmail = $("#bl_txtFilter_Email").val().trim();
        var adviceTel = $("#bl_txtFilter_Tel").val().trim();
        var adviceContact = DoHtmlReplace($("#bl_txtFilter_Contact").val().trim());
        if (adviceEmail != "" && !checkEmail(adviceEmail)) {
            strErr = emailError; //EMAIL格式填写错误!
            InboxEngine.SetErrTip($('#bl_txtFilter_Email'), strErr);
            return;
        }
        if (!checkPhone(adviceTel)) {
            strErr = telError; //电话格式填写错误!
            InboxEngine.SetErrTip($('#bl_txtFilter_Tel'), strErr);
            return;
        }
        if (adviceContact.length > 100) {
            strErr = maxContactCharacters; //联系人不能超过100个字!
            InboxEngine.SetErrTip($('#bl_txtFilter_Contact'), strErr);
            return;
        }
        if (EHRBlackList.GetCharLength(adviceEmail) > 80) {
            strErr = maxEmailCharacters; //EMAIL不能超过80个字符!
            InboxEngine.SetErrTip($('#bl_txtFilter_Email'), strErr);
            return;
        }
        if (EHRBlackList.GetCharLength(adviceTel) > 20) {
            strErr = maxTelCharacters; //电话不能超过20个字符!
            InboxEngine.SetErrTip($('#bl_txtFilter_Tel'), strErr);
            return;
        }
        var strContent = "";
        var strReason = "0";
        $('input[name="bl_reason"][type="radio"]').each(function () {
            if ($(this).attr('checked'))
                strReason = $(this).attr("value");
            if (strReason == '9')
                strContent = escape(encodeURIComponent($("#bl_txtRemark").val()));
        });
        var strPut2Black = "0";
        if (document.getElementById("bl_chkBlacklist").checked) {
            strPut2Black = "1";
        }
        if (strReason == "0" && strPut2Black!="1") {
            strErr = selectReason; //请选择举报原因
            InboxEngine.SetErrTip($('#bl_txtRemark'), strErr);
            return;
        }
        //业务处理
        var strIsFilter = "0";
        if (document.getElementById("hidIsFilter") != null) {
            strIsFilter = $("#hidIsFilter").val();
        }
        var popFolderType = '';
        if ($("#hidFolder")) {
            popFolderType = $("#hidFolder").val();
        }
        var strPostdata = "doType=SaveResult&seqid=" + InboxParams["hidSeqID"] + "&userId=" + InboxParams["hidUserID"] + "&folder=" + popFolderType + "&reason=" + strReason + "&strIsFilter=" + strIsFilter + "&content=" + strContent + "&put2black=" + strPut2Black;
        strPostdata += "&contact=" + escape(adviceContact) + "&email=" + escape(adviceEmail) + "&tel=" + escape(adviceTel) + "&ImagePath=" + ImagePath;
        EHR.Common_AsyncHandle("POST", "xml", "InboxResume/GlobalBlackListAjax.ashx", strPostdata, EHRBlackList.DisposeResult, 1);
    }
    EHRBlackList.DisposeResult = function (result) {
        EHRBox.CloseBox("#" + EHRBox.config.curBoxID);
        var msgtype = $(result).find("msgtype").eq(0).text();
        var returninfo = $(result).find("returninfo").eq(0).text();

        if (msgtype == "1") {
            var retInfo = returninfo.split('|');
            if (retInfo.length > 1) {
                InboxParams["BlklstSuccessSeqIds"] = retInfo[1];
                EHR.ShowBox(retInfo[0], 300, 0, "EHRBlackList.ProcessResult()", true);
            }
            else {
                EHR.ShowBox(returninfo, 300, 0, "EHRBlackList.ProcessResult()", true);
            }
        }
        else {
            EHR.ShowBox(returninfo, 300);
        }
    }
    EHRBlackList.ProcessResult = function () {
        if (InboxParams["BlklstSuccessSeqIds"] && InboxParams["BlklstSuccessSeqIds"] != "") {
            var arrSuccessSeqIds = InboxParams["BlklstSuccessSeqIds"].split(',');
            if ($("#hidAllSeqIds").length > 0) {
                try {
                    RefreshOpener_folder();
                }
                catch (ex) { }
                if ($("#hidAllSeqIds").val().split(',').length == 1 || ($("#hidAllSeqIds").val().split(',').length == arrSuccessSeqIds.length)) {
                    $("html").html("");
                    window.close();
                }
                else {
                    var bNeedRefresh = false;
                    for (var i = 0; i < arrSuccessSeqIds.length; i++) {
                        if (i == arrSuccessSeqIds.length - 1) {
                            bNeedRefresh = true;
                        }
                        else {
                            bNeedRefresh = false;
                        }
                        tab_RemoveUser(arrSuccessSeqIds[i], bNeedRefresh);
                        tab_BuildUserList("folder", 1);
                    }
                }
            }
        }
    }
    EHRBlackList.GetCharLength = function(str) {
        var charLen = 0;
        for (var i = 0, len = str.length; i < len; i++) {
            if (str.charCodeAt(i) > 255) {
                charLen += 2;
            } else {
                charLen += 1;
            }
        }
        return charLen;
    }
    //根据传入的最大长度限制信件内容
    EHRBlackList.CheckContentLength = function (maxLen, obj) {
        $("#err_blacklist_content").html("");
        var content = $(obj).val();
        var length = content.length;
        if (length > maxLen) {
            content = content.substring(0, maxLen);
            $(obj).val(content);
            $("#bl_txtRemark_limit").html(BlackList_Con_Limit.replace('{0}', maxLen).replace('{1}', maxLen));
        }
        else {
            $("#bl_txtRemark_limit").html(BlackList_Con_Limit.replace('{0}', length).replace('{1}', maxLen));
        }
    }
    /* 举报/黑名单 end*/

    /* 放入暂存夹 begin */
    EHRToTemp = {};
    EHRToTemp.showDialog = function () {
        EHR.ShowBox(ToTempAlert, 300, true, 'EHRToTemp.MoveToTemp();', false, true);
    };
    EHRToTemp.MoveToTemp = function () {
        var strIsFilter = "0";
        if (gid("hidIsFilter") != null) {
            strIsFilter = $("#hidIsFilter").val();
        }
        var strFolder = $("#resumeViewFolderType").val();
        var strUnames = "";
        strUnames = escape(encodeURIComponent(strUnames));
        var onew = $('#oldnew').val()== undefined ? ""  : $('#oldnew').val();
        var $userid =  onew == "" ? InboxParams["hidUserID"] : InboxParams["hidUserID"] + "#" + onew;
        var strPostdata = "doType=ToTemp" + "&strIsFilter=" + strIsFilter + "&seqId=" + InboxParams["hidSeqID"] + "&userId=" + $userid  + "&Folder=" + strFolder + "&Unames=" + strUnames + "&pageCode=" + GetUrlQuerystring("pageCode");
        var hidTxtIsRecommended = $("#hidIsRecommended");
        if (hidTxtIsRecommended.length > 0) {
            if (hidTxtIsRecommended.val() == "1") {
                strPostdata += "&recommend=1";
            }
        }
        EHR.Common_AsyncHandle("POST", "xml", "InboxResume/GlobalInboxCommonAjax.ashx", strPostdata, EHRToTemp.SetResult, 1);
    };
    EHRToTemp.SetResult = function (result) {
        var returninfo = $(result).find("returninfo").eq(0).text();
        EHR.ShowBox(returninfo, 300, true, 'InviteNew.refrashPage();', false, true);
    };
    /* 放入暂存夹 end */

    /* 小精灵下载简历 begin */
    EHRDownLoad = {};
    EHRDownLoad.showDialog = function () {
        EHR.ShowBox(DownLoadAlert, 350, true, 'EHRDownLoad.DoDownLoad();', false, true);
    };
    EHRDownLoad.DoDownLoad = function (extraParam)
    {
        var strWhere = "";
        if (gid('hidWhere') != null) strWhere = "&strWhere=" + escape(encodeURIComponent(gid('hidWhere').value)); //记录搜索条件日志，列表页面应该是这样获取的，但可能对于小精灵页面有所不同
        var onew = $('#oldnew').val()== undefined ? "" : $('#oldnew').val();
        var tmpUserid = onew == "" ? InboxParams["hidUserID"] : InboxParams["hidUserID"] + "#" + onew;
        if ((tmpUserid == undefined || tmpUserid == '') && EHRRecommend.recomid != undefined) tmpUserid = EHRRecommend.recomid;
        var strPostdata = "doType=SearchToCompanyHr&isNew=1&OprType=1" + "&userId=" + tmpUserid;
        //strPostdata += (userid != undefined && userid !="" )? "&isSingleUser=1" : "";
        strPostdata += strWhere;
        var hidTxtIsRecommended = $("#hidIsRecommended");
        if (hidTxtIsRecommended.length > 0)
        {
            if (hidTxtIsRecommended.val() == "1")
            {
                strPostdata += "&recommend=1";
            }
        }
        strPostdata += "&markid=" + encodeURIComponent($('#hideMarkid').val()) + "&pageCode=" + GetUrlQuerystring("pageCode");
        if (extraParam != null)
        {
            strPostdata += extraParam;
        } 
        if (EHRRecommend.recomid != undefined && EHRRecommend.recomid != "")
        {
            EHR.Common_AsyncHandle("POST", "xml", "Resume/GlobalDownload.aspx", strPostdata, EHRRecommend.DownLoad.SucHandler, 1);
        } else
        {
            EHR.Common_AsyncHandle("POST", "xml", "Resume/GlobalDownload.aspx", strPostdata, EHRDownLoad.SetResult, 1);
        }
    };
    EHRDownLoad.SetResult = function (result) {
        if (typeof (result) != 'object') return false;
        var msgtype = $(result).find("msgtype").eq(0).text(); //服务器返回状态1为成功11为定制0其他情况为失败
        var returninfo = $(result).find("returninfo").eq(0).text(); //服务器返回的信息
        if (msgtype == "1")  //下载成功
        {
            var lhref = location.href.toLowerCase();
            if (lhref.indexOf("resumeviewnew.aspx") > 0 && $("#hidAllSeqIds").val().split(',').length == 1 || $("#hidCheckedSeqIds").val().split(',').length == 1)//ResumeView页面单份下载简历不需要提示成功确认
            {
                post_to_url(window.location.href, {}, 'form1');  //一份简历的时候不出弹框
            } else {
                EHR.ShowBox(returninfo, 350, true, 'InviteNew.refrashPage();', false, true);
            }
        }
        else if (msgtype == "11")    //11为需要定制情况
        {
            $("#invite_customized_content").html(returninfo);
            $("#p_customized_alert").html(invite_SelectNumber);
            EHR.ShowDivBox("#div_invite_customized");
        }
        else if (msgtype == "22") {    //22为下载简历在收件箱中（提示+刷新）
            EHR.ShowBox(returninfo, 350, true, 'InviteNew.refrashPage();', false, true);
        }
        else {
            EHR.ShowBox(returninfo, 350);
        }
    };
    /* 小精灵下载简历 end */
/******************** 应聘简历***************/
/*全选*/
InboxEngine.SelectAllArea = function (obj) {
    objThis = $(obj);
    if (objThis.attr('checked')) {
        //全选
        $('input[name="multiArea"][type="checkbox"]').each(function () {
            $(this).attr('checked', true);
        });
    } else {
        //全取消
        $('input[name="multiArea"][type="checkbox"]').each(function () {
            $(this).attr('checked', false);
        });
    }
}
/*单选时，更改全选样式*/
InboxEngine.SelectArea = function () {
    //选中
    var objChecked = $('input[name="multiArea"][type="checkbox"]:checked');
    //总共个数
    var objSelect = $('input[name="multiArea"][type="checkbox"]');
    if (objChecked.length == objSelect.length) {
        //全选
        $('input[name="multiAreaAll"][type="checkbox"]').attr('checked', true);
    } else {
        //全取消
        $('input[name="multiAreaAll"][type="checkbox"]').attr('checked', false);
    }
}
/*多地区职位查看简历*/
InboxEngine.MultiAreaView = function () {
    var obj = $('input[name="multiArea"][type="checkbox"]:checked');
    //是否有选中checkbox
    if (obj.length > 0) {
        //清除当前多地区jobid
        $('#HidJobIds').val('');
        var selectJob = '';
        var selectJobC = '';
        obj.each(function () {
            //拼接职位多地区jobid
            selectJob += $(this).val() + ",";
            selectJobC += $(this).attr('value1') + ","

        });
        //去除末尾“，”
        selectJob = selectJob.substring(0, selectJob.length - 1);
        selectJobC = selectJobC.substring(0, selectJobC.length - 1);
        $('#HidJobIds').val(selectJob);
        $('#HidJobValues').val(selectJobC);
        $('#btnSelect')[0].click(); //查询
    }
    else {
        EHR.ShowBox('请选择数据！', 300);
    }
}
//简历多投
MultiResume = {};
InboxEngine.OpenMultiResume = function () {
    var strUserId = InboxParams['hidUserID'];
    var strSeqId = InboxParams['hidSeqID'];
    if (InboxParams["isResumeView"] == '1') {
        strUserId = $("#hidUserID").val();
        strSeqId = $("#hidSeqID").val();
    }
    postData = {
        doType: 'FetchMultiResumeData',
        UserID: strUserId,
        curCvlogId: strSeqId
    }
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalMultiSendResume.ashx", postData, MultiResume.OpenMultiResumeResult);
}
//简历多投"POST", "xml",
MultiResume.OpenMultiResumeResult = function (result) {

    $('#div_MultiResume').remove();
    if (InboxEngine.IsReloginTip(result)) return;
    var multiDiv = "<div class='panel_lnp' id='div_MultiResume' style='display:none;'>" + $(result).find('message').eq(0).text() + "<div>";
    $("body").append(multiDiv);
    EHRBox.config.curBoxID = "div_MultiResume";
    EHRBox.ShowBox("#div_MultiResume");

}
//确认是否删除
MultiResume.ConfirmDeleteRecord = function (cvlogId, jobId, key) {
    EHR.ShowBoxTwo(lang.toLowerCase().indexOf("en") > -1 ? "Delete?" : "请确认是否删除?", 300, 1, "MultiResume.DeleteRecord(\"" + cvlogId + "\",\"" + jobId + "\",\"" + key + "\");");
}
//删除
MultiResume.DeleteRecord = function (cvlogId, jobId, key) {
    var postData = { doType: "DelMultiResumeData", CvlogId: cvlogId, JobId: jobId, strKey: key, hidIsFilter: InboxEngine.GetIsFilter(), SourceCode: InboxParams['SourceCode'] };
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalMultiSendResume.ashx", postData, MultiResume.DeleteRecordResult);
}
//删除结果
MultiResume.DeleteRecordResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    if ($(result).find("message").eq(0).text() != "Error") {
        if ($(result).find("message").eq(0).text() == "success") {
            //GetMultiResumeData();
            var cvlogid = $(result).find("cvlogid").eq(0).text();
            $("#div_MultiResume li[id='MultiResume_" + cvlogid + "']").remove();
        }
        else {
            var ret = $(result).find("returninfo").eq(0).text();
            if (ret == "") {
                ret = $(result).find("message").eq(0).text();
            }
            EHR.ShowBoxTwo(ret, 300);
        }
    }
}
/********************End  应聘简历***************/

/*-------------------------验证公司，主题，内容，邮箱，同时发送邮箱，短信数-------------------------*/
/*共用部分*/
/*
验证发送数据合法性
checkCom:检查公司 checkSub：检查主题 checkCon：检查内容 checkSynMail：检查发送邮件邮箱 checkMail：检查同时发送邮件邮箱
*/
InboxEngine.CheckSendData = function (checkCom, checkSub, checkCon, checkSynMail, checkMail) {
    strErr = "";
    //检查发现公司
    if (checkCom && !InboxParams['sel_' + InboxEngine.MsgBoxType + '-c']) {
        strErr = InboxParamsErr['mailcompany'];
        var obj = $('#txt_' + InboxEngine.MsgBoxType + '-c');
        InboxEngine.SetErrTip(obj, strErr);
        return 0;
    }
    //检查主题
    if (checkSub && !InboxEngine.CheckSendDataForSub())
        return 0;
    //检查内容
    if (checkCon && !InboxEngine.CheckSendDataForContent())
        return 0;
    //检查同时发送email
    if (checkMail && $("#" + checkMail + "").attr("checked")) {
        if (!InboxEngine.CheckSendDataForEmail())
            return 0;
    }
    //检查email
    if (checkSynMail && !InboxEngine.CheckSendDataForSynEmail())
        return 0;

    return 1;
}
/*验证邮箱是否合法*/
InboxEngine.CheckSendDataForSynEmail = function (objChk, obj) {
    if (!objChk)
        objChk = 'chk_' + InboxEngine.MsgBoxType + '_sendemail';
    if (!obj)
        obj = "txt_" + InboxEngine.MsgBoxType + "_reply";
    //选择了发送邮件
    if ($('#' + objChk).attr('checked')) {
        //邮件输入且合法
        if ($("#" + obj).val().replace(/\s/gi, "").length < 1 || !checkEmail($("#" + obj).val())) {
            var strErr = InboxParamsErr['plaseinputvalidemail'];
            var obj = $("#" + obj);
            InboxEngine.SetErrTip(obj, strErr);
            return 0;
        }
    }
    return 1;
}
/*验证收件人邮箱是否合法*/
InboxEngine.CheckSendDataForEmail = function (obj) {
    if (!obj)
        obj = "txt_" + InboxEngine.MsgBoxType + "_mailto";
    strErr = "";
    //1.验证收件人邮箱
    if ($("#" + obj).val().replace(/\s/gi, "").length < 1) {
        //1.1显示错误信息
        strErr = InboxParamsErr['plaseinputvalidemail'];
    }
    else {
        //1.2验证收件人邮箱是否超出3个
        $("#" + obj).val($("#" + obj).val().replace(/^[\s]+|[\s]+$/g, "").replace(/^[;]+|[;]+$/g, "")); //去除前后空格及;
        var vals = $("#" + obj).val().split(";");
        if (vals.length > 3)//先判个数
        {
            //1.2.1显示错误信息
            strErr = InboxParamsErr['caninputmax3email'];
        }
        else {
            //1.3循环验证每个邮箱是否合法
            for (var i = 0; i < vals.length; i++) {
                if (vals[i] != "" && !checkEmail(vals[i])) {
                    //只有一个邮箱
                    if (vals.length == 1) {
                        //1.3.1显示错误信息
                        strErr = InboxParamsErr['plaseinputvalidemail'];
                    }
                    else {
                        //1.3.2多个邮箱显示错误 InboxParamsErr['commonemailerr'].replace("{0}", i + 1);
                        strErr = InboxParamsErr['plaseinputvalidemail'];
                    }
                    break;
                }
            }
        }
    }
    if (strErr != '') {
        var objThis = $("#" + obj);
        InboxEngine.SetErrTip(objThis, strErr);
        return 0;
    }
    return 1;
}
/*验证内容是否合法
obj:需要验证的obj
errText:错误提示
isCheckInput:是否验证输入
*/
InboxEngine.CheckSendDataForContent = function (isCheckInput, obj, errText) {
    //验证控件id
    if (!obj)
        obj = "txt_" + InboxEngine.MsgBoxType + "_content";
    //提示文案：如信件内容，后半部分统一
    if (!errText)
        errText = InboxParamsErr['mailcontent'];
    strErr = "";
    //是否输入
    if (!isCheckInput && $("#" + obj).val().replace(/\s/gi, "").length < 1) {
        strErr = InboxEngine.GetErrorTip(InboxParamsErr['commoncannotnull'], errText);
    }
    else {
        //是否含有标签
        if (EHR.hasHtmlTag($("#" + obj).val())) {
            strErr = InboxEngine.GetErrorTip(InboxParamsErr['commoncaninputtxt'], errText);
        }
    }
    if (strErr != '') {
        var objThis = $("#" + obj);
        //显示错误信息
        InboxEngine.SetErrTip(objThis, strErr);
        return 0;
    }
    return 1;
}
//*验证主题是否合法*//
InboxEngine.CheckSendDataForSub = function (obj, errText, len) {
    //验证控件id
    if (!obj)
        obj = "txt_" + InboxEngine.MsgBoxType + "_sub";
    //提示文案：如信件主题，后半部分统一
    if (!errText)
        errText = InboxParamsErr['mailsub'];
    //长度
    if (!len)
        len = 150;
    strErr = "";
    //验证是否超过150字
    if (trim($("#" + obj).val()).length > 150) {
        strErr = InboxEngine.GetErrorTip(errText + InboxParamsErr['commoninputmax'], len);
    }
    else {
        //是否含有标签
        if (EHR.hasHtmlTag($("#" + obj).val())) {
             strErr = InboxEngine.GetErrorTip(InboxParamsErr['commoncaninputtxt'], errText);
        }
    }
    if (strErr != '') {
        var objThis = $('#' + obj);
        //显示错误信息
        InboxEngine.SetErrTip(objThis, strErr);
        return 0;
    }
    return 1;
}

/*检查短信数是否足够*/
InboxEngine.CheckSMGNum = function () {
    //选择发送短信
    if ($('#chk_' + InboxEngine.MsgBoxType + '_sendmobile').attr("checked")) {
        if ($('#div_' + InboxEngine.MsgBoxType + '_num').find('a').length > 0) {
            //短信数不足，提示信息
            $('#div_' + InboxEngine.MsgBoxType + '_nonum').html(InboxParamsErr['msgnotenough']).show();
            return 1;
        }
    }
    return 0;
}
/*-------------------------验证公司，主题，内容，邮箱，同时发送邮箱，短信数 END-------------------------*/
/*-------------------------设置部分--------------------------------------------------*/

/*设置默认数据
*选择用户，公司下拉框，用户邮箱
*/
InboxEngine.SetDefData = function (result) {
    //设置已选择简历
    var seluserNames = $(result).find('selusername').eq(0).text();
    $('#' + InboxEngine.MsgBoxType + '_resume_selected').html(seluserNames);
    //设置默认发信公司
    var dropcom = $(result).find('companylist').eq(0).text();
    $('#div_' + InboxEngine.MsgBoxType + '-c').find('div.gdownList').remove();
    $('#div_' + InboxEngine.MsgBoxType + '-c').find('input').after(dropcom);
    var selectedcoid = $(result).find('defcoid').eq(0).text();
    //默认发信公司不为空
    if (selectedcoid != '') {
        var selectedcom = $('#div_' + InboxEngine.MsgBoxType + '-c').find('.gdownList').find('a').text();
        //发信公司名称
        InboxParams['sel_' + InboxEngine.MsgBoxType + '-c'] = selectedcom;
        //发送公司id
        InboxParams[InboxEngine.MsgBoxType + '-c'] = $(result).find('defcoid').eq(0).text();
        var color = '#3b3b3b';
        if (selectedcom == InboxParamsErr['plaseselect'])
            color = '#b4b4b4';
        $('#txt_' + InboxEngine.MsgBoxType + '-c').css('color', color).val(selectedcom);
    }
    else {
        //发信公司名称
        InboxParams['sel_' + InboxEngine.MsgBoxType + '-c'] = '';
        //发送公司id
        InboxParams[InboxEngine.MsgBoxType + '-c'] = '';
        $('#txt_' + InboxEngine.MsgBoxType + '-c').css('color', '#b4b4b4').val(InboxParamsErr['plaseselect']);
    }
    //默认模板
    $('#div_' + InboxEngine.MsgBoxType + '-t').find('div.gdownList').remove();
    $('#div_' + InboxEngine.MsgBoxType + '-t').find('input').after($(result).find('mailtemplate').eq(0).text());
    $('#txt_' + InboxEngine.MsgBoxType + '-t').css('color', '#b4b4b4').val(InboxParamsErr['plaseselect']);
    //模板名称
    InboxParams['sel_' + InboxEngine.MsgBoxType + '-t'] = '';
    //模板id
    InboxParams[InboxEngine.MsgBoxType + '-t'] = '';
    //用户邮箱
    var useremail = $(result).find('defuseremail').eq(0).text();
    $('#txt_' + InboxEngine.MsgBoxType + '_reply').css('color', '#3b3b3b').val(useremail);
    $('#txt_' + InboxEngine.MsgBoxType + '_content').val('');
    $('#chk_' + InboxEngine.MsgBoxType + '_sendemail').attr('checked', 'checked');
    $('#txt_' + InboxEngine.MsgBoxType + '_mailto').val('');
    $('#div_' + InboxEngine.MsgBoxType + '_num,#div_' + InboxEngine.MsgBoxType + '_nonum').css('display', 'none');
}
/*设置已选择的用户样式*/
InboxEngine.SetSelectUserHeight = function () {
    var obj = $('#' + EHRBox.config.curBoxID).find("p[id$='_resume_selected']");
    obj.attr('height', '').css('height', '');
    //已选择用户宽度
    var wid = 0;
    obj.find('span').each(function () {
        wid += $(this).width() - 10;
    });
    if (wid > 210) {
        //显示更多按钮
        obj.find('a').css("display", "block");
    }
    else
    //隐藏更多按钮
        obj.find('a').css("display", "none");
}
/*设置参数*/
InboxEngine.SetDefParams = function (result) {

    //默认内容
    InboxParams['defcontent'] = $(result).find("defcontent").eq(0).text();
    //默认用户邮箱
    InboxParams['defuseremail'] = $(result).find("defuseremail").eq(0).text();
    //已选择简历seqid
    InboxParams['seqid'] = $(result).find('seqid').eq(0).text();
    //已选择简历userid
    InboxParams['userid'] = $(result).find('userid').eq(0).text();
    //已选择简历名称
    InboxParams['username'] = $(result).find('username').eq(0).text();
    //已选择职位id
    InboxParams['jobid'] = $(result).find('jobid').eq(0).text();
    //已选择职位名称
    InboxParams['jobname'] = $(result).find('jobname').eq(0).text();
    //剩余短信数
    InboxParams['smscount'] = $(result).find('smscount').eq(0).text();
    //短信提示语
    InboxParams['smscountmsg'] = $(result).find('smscountmsg').eq(0).text();
    //是否已购买
    InboxParams['isorder'] = $(result).find('isorder').eq(0).text();
    //默认发信公司
    InboxParams['defcoid'] = $(result).find("defcoid").eq(0).text();
    //默认发信公司名称
    InboxParams['defconame'] = $(result).find("defconame").eq(0).text(); //
    InboxParams['cvlogids'] = $(result).find("cvlogids").eq(0).text(); //cvlogids
}
InboxEngine.SetDefParamsByHtml = function () {
    InboxParams[InboxEngine.MsgBoxType] = ['deferr', 'defsub', 'defcurtxt'];
    //默认当前输入
    InboxParams[InboxEngine.MsgBoxType]['defcurtxt'] = $('#cur_' + InboxEngine.MsgBoxType + '_screen').html();
    //默认主题
    InboxParams[InboxEngine.MsgBoxType]['defsub'] = $('#txt_' + InboxEngine.MsgBoxType + '_sub').val();
    //默认错误信息
    InboxParams[InboxEngine.MsgBoxType]['deferr'] = $('#err_' + InboxEngine.MsgBoxType + '_txt').val() || $('#err_' + InboxEngine.MsgBoxType + '_content').text();
}
/*初始化绑定事件*/
InboxEngine.InitBindClick = function () {
    //绑定恢复模板
    var wordLen = '';
    if (InboxEngine.MsgBoxType == "rsm")
        wordLen = 500; //测评管理500字
    $('#a_' + InboxEngine.MsgBoxType + '_recover').click(function () {
        InboxEngine.RecoverTemplateContent(wordLen);
    });
    //绑定同时发送短信
    $('#chk_' + InboxEngine.MsgBoxType + '_sendmobile').click(function () {
        InboxEngine.SengMobileMsg(this);
    });
    //绑定面试官邮箱
    $('#div_' + InboxEngine.MsgBoxType + '_mailtolist').siblings('a').click(function () {
        InboxEngine.FetchEmailDivData();
    });

}
//绑定发送邮件
//chk:发送消息的checkbox,txt：输入mail的text
InboxEngine.InitSendMail = function (chk, txt) {
    var chkSendMail = 'chk_' + InboxEngine.MsgBoxType + '_sendemail';
    var txtSendMail = 'txt_' + InboxEngine.MsgBoxType + '_reply';
    if (chk)
        chkSendMail = chk;
    if (txt)
        txtSendMail = txt;
    //绑定发送邮件
    $('#' + chkSendMail).click(function () {
        //InboxEngine.SengMobileMsg(this);
        var obj = $('#' + txtSendMail)
        if (obj.siblings('span')) {
            if (obj.parent('div').hasClass('active'))
                obj.siblings('span').html('');
        }
        obj.parent('div').removeClass('active');
    });
}
/*------------------------Email--------------------------------*/
/*获取收件人邮箱列表*/
InboxEngine.FetchEmailDivData = function () {
    var obj = $('#txt_' + InboxEngine.MsgBoxType + '_mailto');
    obj.parent('div').removeClass('active');
    obj.siblings('span').html(InboxParams['deftip'] ? InboxParams['deftip'] : '');
    //obj.css('','');
    var obj = $('#div_' + InboxEngine.MsgBoxType + '_mailtolist');
    //是否以获取邮箱列表
    if (obj.html() == "") {
        var postData = { "doType": "FetchEmailDivData" };
        EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalInboxCommonAjax.ashx", postData, InboxEngine.FetchEmailDivDataResult);
    }
    else if (obj.is(":hidden")) {
        //绑定收件人邮箱列表
        InboxEngine.SetEmailChecked(obj);
    }
    else {
        obj.hide();
    }
    //$('#txt_' + InboxEngine.MsgBoxType + '_mailto').focus();
}
/*设置已选择的邮箱*/
InboxEngine.SetEmailChecked = function (obj) {
    //1.去除已选择邮箱前后空格及“；”
    var email = $('#txt_' + InboxEngine.MsgBoxType + '_mailto').val().replace(/^[\s]+|[\s]+$/g, "").replace(/^[;]+|[;]+$/g, "");
    //2.判断邮箱是否已选择
    var selectedMail = InboxParams['selectedmail'] ? InboxParams['selectedmail'] : '';
    var mailTemp = '';
    if (selectedMail != "") {
        //3已选择的收件人邮箱ID数组,判断下拉框是否存在已选择邮箱
        var selectedMails = selectedMail.split(',');
        if (selectedMails.length > 0) {
            email = ";" + email + ";";
            for (var i = 0; i < selectedMails.length; i++) {
                //3.1如果为空，继续下一循环
                if (selectedMails[i] == '') continue;
                //3.2判断已选择邮箱是否存在
                var objMail = $('#' + selectedMails[i]);
                if (objMail.length > 0) {
                    thisMail = objMail.attr('e');
                    //3.2.1已选择邮箱存在，设置背景色
                    if (email.indexOf(';' + thisMail + ';') > -1) {
                        //3.2.2重新赋值已绑定的邮箱
                        mailTemp += selectedMails[i] + ',';
                        objMail.css('background', '#d4ecff');
                    }
                    else {

                        objMail.css('background', '');
                    }
                }
                else {
                    objMail.css('background', '');
                }
            }
        }
    }
    else {
        $('#div_' + InboxEngine.MsgBoxType + '_mailtolist').find('a').css('background', '');
    }
    InboxParams['selectedmail'] = mailTemp;
    obj.show();
}
/*设置收件人邮箱样式，填充html*/
InboxEngine.FetchEmailDivDataResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var strHtml = "";
    var obj = $('#div_' + InboxEngine.MsgBoxType + '_mailtolist');
    $(result).find("message").each(function (i) {
        var strHruID = $(this).children("hruid").text();
        var strName = $(this).children("name").text();
        var strMail = $(this).children("email").text();
        if (strHruID != "" && strMail != "") {
            strHtml += "<a style='cursor:pointer' id='email_" + InboxEngine.MsgBoxType + "_" + strHruID + "' title='&quot;" + strName + "&quot;&lt;" + strMail + "&gt;' e='" + strMail + "' onclick=\"InboxEngine.SetTxtMailTo('" + strMail + "',this)\">&quot;" + strName + "&quot;&lt;" + strMail + "&gt;</a>";
        }
    });
    obj.html(strHtml);
    //设置邮件下拉框高度
    if (obj.children('a').length > 5) {
        if ((obj.css('width').replace('px', '')) < 200) {
            if (lang == 'en') {
                obj.css("width", "152px");
            }
            obj.css("height", "130px");
        }
        else {
            obj.css("height", "190px");
        }
    }
    else {
        obj.css("height", "auto");
    }
    obj.mouseleave(function () {
        $(this).hide();
    });
    InboxEngine.SetEmailChecked(obj);
}
/*选择email*/
InboxEngine.SetTxtMailTo = function (mail, objThis) {
    var dropID = "div_" + InboxEngine.MsgBoxType + "_mailtolist";
    var obj = "#txt_" + InboxEngine.MsgBoxType + "_mailto";
    var curMail = $(obj).val();
    var strMail = curMail.split(';');
    var count = 0;
    //判断已选邮箱个数
    for (var i = 0; i < strMail.length; i++) {
        if ($.trim(strMail[i]) != "") {
            count++;
        }
    }
    //大于3个，直接隐藏下拉框
    if (count >= 3) {
        //$("#" + errorID).html(common_Max);
        $("#" + dropID).hide();
        return;
    }
    //邮箱已选择
    var existEmail = ";" + curMail + ";";
    if (existEmail.indexOf(";" + mail + ";") != -1) {
        //$("#" + errorID).html(common_exisitMail);
        $("#" + dropID).hide();
        return;
    }
    //将选择邮箱填入文本框
    if ($.trim($(obj).val()) == "") {
        $(obj).val(mail + ";")
    }
    else if (curMail.substring(curMail.length - 1, curMail.length) != ";") {
        $(obj).val(mail + ";" + $(obj).val() + ";");
    }
    else {
        $(obj).val(mail + ";" + $(obj).val());
    }
    $(obj).css('color', '#3b3b3b');
    //保存已选择的收件人的emailid
    var selectedMail = InboxParams['selectedmail'] ? InboxParams['selectedmail'] : '';
    selectedMail += $(objThis).attr('id') + ',';
    InboxParams['selectedmail'] = selectedMail;
    //$("#" + errorID).html("");
    $(obj).attr("title", $(obj).val());
    $("#" + dropID).hide();
}
/*获取邮件模板列表*/
InboxEngine.GetTemplateList = function (type) {
    var postData = { doType: 'GetTemplateList' };
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalSendMaessageAjax.ashx", postData, InboxEngine.GetTemplateListResult);
}
/*获取邮件模板列表结果*/
InboxEngine.GetTemplateListResult = function (result) {
    //var msgtype = $(result).find('message').eq(0).text();
    var obj = $('#div_' + InboxEngine.MsgBoxType + '-t');
    obj.find('.gdownList').remove();
    obj.find('input').after($(result).find('mailtemplate').eq(0).text());
    obj.children("input[type='text'][readonly='readonly']").css("border-color", "#5191ce");
    obj.find('div.gdownList').show();
}

/*---------------------------Email End----------------------------*/
/*-------------------------模板 END--------------------------------------------------*/
/*设置模板信息*/
InboxEngine.GetTemplateContent = function (target) {
    //移除主题错误样式
    $('#txt_' + InboxEngine.MsgBoxType + '_sub').parent('div').removeClass('active');
    if (InboxParams[InboxEngine.MsgBoxType + '-t']) {
        var postData = { doType: 'FetchMailTemplet', 'TempletID': InboxParams[InboxEngine.MsgBoxType + '-t'] };
        EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalProcInterviewAjax.ashx", postData, InboxEngine.GetTemplateContentResult);
    }
    else {
        if (target.getAttribute('t') && !InboxParams[InboxEngine.MsgBoxType + '-t']) {
            //选择请选择时，模板恢复到默认值
            $('#txt_' + InboxEngine.MsgBoxType + '_reply').val(InboxParams['defuseremail']);
            $('#txt_' + InboxEngine.MsgBoxType + '_content').val(InboxParams['defcontent']);
            var sub = InboxParams[InboxEngine.MsgBoxType]['defsub'];
            if (InboxParams['username'].split(',').length > 1) {
                sub = sub.replace('{0}', '');
            }
            else {
                sub = sub.replace('{0}', InboxParams['username'] + ",");
            }
            $('#txt_' + InboxEngine.MsgBoxType + '_sub').val(sub);
            InboxEngine.CheckContentLength();
        }
    }
}
/*获取模板内容结果设置*/
InboxEngine.GetTemplateContentResult = function (result) {
    if (InboxEngine.IsReloginTip(result)) return;
    var strContent = $(result).find('content').eq(0).text();
    var strEmail = $(result).find('email').eq(0).text(); ;
    var strTitle = $(result).find('title').eq(0).text();

    var userIDs = InboxParams['userid'];
    if (userIDs.indexOf(",") > -1) {
        strContent = strContent.replace(/\[NAME\]/g, "  ");
        strContent = strContent.replace(/\[姓名\]/g, "  ");
        strTitle = strTitle.replace(/\[NAME\]/g, "  ");
        strTitle = strTitle.replace(/\[姓名\]/g, "  ");
    }
    else {
        var objTypeHidNames = InboxParams['username'];
        if (objTypeHidNames.length > 0) objTypeHidNames = objTypeHidNames.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&nbsp;/g, " ").replace(/&#39;/g, "\'").replace(/&quot;/g, "\"");
        strContent = strContent.replace(/\[NAME\]/g, objTypeHidNames);
        strContent = strContent.replace(/\[姓名\]/g, objTypeHidNames);
        strTitle = strTitle.replace(/\[NAME\]/g, objTypeHidNames);
        strTitle = strTitle.replace(/\[姓名\]/g, objTypeHidNames);


    }

    if (InboxParams['jobname']) {
        var jobname = InboxParams['jobname'];
        strContent = strContent.replace(/\[JOBNAME\]/g, jobname);
        strContent = strContent.replace(/\[职位名\]/g, jobname);
        strTitle = strTitle.replace(/\[JOBNAME\]/g, jobname);
        strTitle = strTitle.replace(/\[职位名\]/g, jobname);
    }
    else {
        strContent = strContent.replace(/\[JOBNAME\]/g, "  ");
        strContent = strContent.replace(/\[职位名\]/g, "  ");
        strTitle = strTitle.replace(/\[JOBNAME\]/g, "  ");
        strTitle = strTitle.replace(/\[职位名\]/g, "  ");
    }
    strCompanyName = InboxParams['sel_' + InboxEngine.MsgBoxType + '-c'];
    if (!strCompanyName)
        strCompanyName = "";
    strContent = strContent.replace(/\[COMPANYNAME\]/g, strCompanyName);
    strContent = strContent.replace(/\[公司名\]/g, strCompanyName);
    strTitle = strTitle.replace(/\[COMPANYNAME\]/g, strCompanyName);
    strTitle = strTitle.replace(/\[公司名\]/g, strCompanyName);
    $("#txt_" + InboxEngine.MsgBoxType + "_content").val(strContent);
    $("#txt_" + InboxEngine.MsgBoxType + "_reply").css('color', '#3b3b3b').val(strEmail);

    $("#txt_" + InboxEngine.MsgBoxType + "_sub").css('color', '#3b3b3b').val(strTitle);

    // EHRIntvPlanBox.CheckWordLength();
    InboxEngine.CheckContentLength();
}
/*恢复默认值*/
InboxEngine.RecoverTemplateContent = function (wordLen) {
    $('#txt_' + InboxEngine.MsgBoxType + '_content').val(InboxParams['defcontent']);
    InboxEngine.CheckContentLength(wordLen);
}
/*-------------------------模板 END--------------------------------------------------*/
/*设置错误提示*/
InboxEngine.SetErrTip = function (obj, strErr) {
    obj.css('border-color', '');
    //显示红框
    obj.parent('div').addClass('active');
    //显示错误提示
    if (obj.siblings('span').length > 0) {
        obj.siblings('span').html(strErr);
    }
    else {
        //显示错误提示
        $('#err_' + InboxEngine.MsgBoxType + '_content').html(strErr);
    }
}
/*设置错误样式*/
InboxEngine.SetError = function (obj) {

    var thisobj = $('#' + obj)
    thisobj.css('border-color', '');
    thisobj.parent('div').addClass('active');

}
/*重新设置弹框高度，否则有样式问题*/
InboxEngine.ResetDivHeight = function () {
    $("#" + EHRBox.config.curBoxID).css('height', "");
}
//设置模板默认内容
InboxEngine.SetUserTemplate = function (result) {
    var defcontent = $(result).find("defcontent").eq(0).text();
    var usercontent = $(result).find("usercontent").eq(0).text();
    InboxParams['defcontent'] = defcontent;
    if (usercontent) {
        $('#txt_' + InboxEngine.MsgBoxType + '_content').val(usercontent);
    }
    else
        $('#txt_' + InboxEngine.MsgBoxType + '_content').val(defcontent);

    //设置主题
    $('#txt_' + InboxEngine.MsgBoxType + '_sub').val(InboxParams[InboxEngine.MsgBoxType]['defsub']);
}
/*-------------------------设置部分 END--------------------------------------------------*/
//获取是否过滤简历
InboxEngine.GetIsFilter = function () {
    var strIsFilter = "0";
    if (document.getElementById("hidIsFilter") != null) {
        strIsFilter = $("#hidIsFilter").val();
    }
    return strIsFilter;
}
/*初始化paste keyup mouseup*/
InboxEngine.InitChangeClick = function (maxLen, obj, curTarget, errTarget) {
    $('#txt_' + InboxEngine.MsgBoxType + '_content').bind('paste keyup mouseup blur', function () {
        InboxEngine.CheckContentLength(maxLen, obj, curTarget, errTarget);
    });
    InboxEngine.CheckWordLength(maxLen, obj, curTarget, errTarget);
}
InboxEngine.CheckContentLength = function (maxLen, obj, curTarget, errTarget) {
    if (InboxParams['sendmobile'])//检查短信内容
        InboxEngine.CheckWordLengthForMsg(maxLen, obj, curTarget, errTarget);
    else//检查邮件内容
        InboxEngine.CheckWordLength(maxLen, obj, curTarget, errTarget);
}

/*检查已输入多少字
*target----需要检查的内容
*maxLen----最大输入
*cruTarget----显示当前输入的id
*errTarget----显示错误提示ID
*/
InboxEngine.CheckWordLength = function (maxLen, target, curTarget, errTarget) {
    //默认需要检查字数的控件id
    if (!target)
        target = 'txt_' + InboxEngine.MsgBoxType + '_content'
    //默认长度
    if (!maxLen)
        maxLen = 1000;
    //默认显示当前输入控件id
    if (!curTarget)
        curTarget = 'cur_' + InboxEngine.MsgBoxType + '_screen';
    //errTarget = "";
    var targetContent = $('#' + target);
    targetContent.parent('div').removeClass('active');
    var targetCur = $('#' + curTarget);
    //默认显示错误控件id
    if (!errTarget)
        errTarget = 'err_' + InboxEngine.MsgBoxType + '_content';
    var targetErr = $("#" + errTarget);
    targetErr.html('');
    //错误文案是否显示
    if (InboxParams[InboxEngine.MsgBoxType]['deferr'] && targetErr.length > 0)
        targetErr.html(InboxParams[InboxEngine.MsgBoxType]['deferr']);
    else
        targetErr.html('');

    var val = targetContent.val();
    var len = val.length;
    var common_current = 0;
    //当前已输入
    var charsCheck = len + "/" + maxLen;

    if (len >= maxLen) {
        targetErr.html(InboxEngine.GetErrorTip(InboxParamsErr['commoncontent'], maxLen));
    }
    //错误信息
    var tip = InboxParams[InboxEngine.MsgBoxType]['defcurtxt'] ? InboxParams[InboxEngine.MsgBoxType]['defcurtxt'] : InboxParamsErr['commoncurinput'];

    if (len <= maxLen) {
        charsCheck = len + "/" + maxLen;
        targetCur.html(tip.replace('{0}', charsCheck));
    }
    else {
        targetContent.val(val.substring(0, maxLen)); //截取maxLen个字符
        len = targetContent.val().length;
        if (len > maxLen)//防止末尾为\r\n的情况
        {
            targetContent.val(val.substring(0, maxLen - 1)); //截取maxLen个字符
            len = targetContent.val().length

        }
        charsCheck = len + "/" + maxLen;
        targetCur.html(tip.replace('{0}', charsCheck));
    }
}
/*短信输入字数
*target----需要检查的内容
*maxLen----最大输入
*cruTarget----显示当前输入的id
*errTarget----显示错误提示ID
*/
InboxEngine.CheckWordLengthForMsg = function (maxwords, target, curTarget, errTarget) {

    //显示错误，默认文案
    if (!errTarget)
        errTarget = 'err_' + InboxEngine.MsgBoxType + '_content';
    var targetErr = $("#" + errTarget);
    if (InboxParams[InboxEngine.MsgBoxType]['deferr'] && targetErr.length > 0)
        targetErr.html(InboxParams[InboxEngine.MsgBoxType]['deferr']);
    else
        targetErr.html('');
    //需要判断字数的控件
    if (!target)
        target = 'txt_' + InboxEngine.MsgBoxType + '_content'
    //显示当前字数
    if (!curTarget)
        curTarget = 'cur_' + InboxEngine.MsgBoxType + '_screen';
    //errTarget = "";
    var targetContent = $('#' + target);
    targetContent.parent('div').removeClass('active');
    var targetCur = $('#' + curTarget);
    //显示需要扣除的短信数
    var targetNum = $('#div_' + InboxEngine.MsgBoxType + '_num');
    var maxwords = 120;
    var curObj = $('#' + curTarget);
    var obj = $('#' + target);
    var val = obj.val();
    var len = val.length;

    //var charsCheck = "{0}/" + maxwords;
    var useNum = InboxParams['userid'].split(",").length;
    if (len > 60) {
        maxwords = "120";
        if (len >= 120) {
            targetErr.html(InboxParamsErr['msgwordthan2']);
        }
        else {
            targetErr.html(InboxParamsErr['msgwordthan1']);
        }
        useNum = useNum * 2;
    }
    else {
        //targetErr.html('');
        maxwords = "120";
    }
    if (!InboxParams['isorder'])   //  购买过合同时，显示“将扣除X条短信(现有余额：X条)”
    {
        InboxParams['SubSmsNum'] = useNum;
        var strSmsLeftCount = InboxParams['smscountmsg'].replace("{0}", useNum);
        strSmsLeftCount = strSmsLeftCount.replace("{1}", InboxParams['smscount']);
        //短信数不足，显示购买链接
        if (useNum > InboxParams['smscount']) {
            strSmsLeftCount += "<a href='/CommonPage/ProductPurchase.aspx?Type=S' target='_blank' class='delfault'>" + InboxParamsErr['contactbuy'] + "</a>";
        }
        else {
            if ($('#div_sendmsg_nonum').length > 0) {
                $('#div_sendmsg_nonum').html('');
            }
        }
        //显示剩余短信数
        targetNum.html(strSmsLeftCount);
    }
    else {
        targetNum.html(InboxParams['isorder']); //未购买过提示语
    }
    if (len <= maxwords) {
        //显示当前输入
        curObj.html(InboxParamsErr['commoncurinput'].replace("{0}", len + '/' + maxwords));
    }
    else {
        obj.val(val.substring(0, maxwords)); //截取maxwords个字符
        len = obj.val().length;
        if (len > maxwords)//防止末尾为\r\n的情况
        {
            obj.val(obj.val().substring(0, maxwords - 1)); //截取maxwords个字符
            len = obj.val().length;
        }
        //显示当前输入
        curObj.html(InboxParamsErr['commoncurinput'].replace("{0}", len + '/' + maxwords));
    }
}
/*同时发送短信*/
InboxEngine.SengMobileMsg = function (obj) {
    $('#div_' + InboxEngine.MsgBoxType + '_nonum').hide();
    //选择同时发送手机短信
    if ($(obj).attr('checked')) {
        //是否购买过
        if (!InboxParams['isorder']) {
            var msg = InboxParams['smscountmsg'];
            var users = InboxParams['userid'].split(',').length;
            var num = InboxParams['smscount'];
            //短信数是否够
            if (users > num) {
                //显示购买链接
                msg += "<a href='/CommonPage/ProductPurchase.aspx?Type=S' target='_blank' class='delfault'>" + InboxParamsErr['contactbuy'] + "</a>";
            }
            //显示剩余短信数
            $('#div_' + InboxEngine.MsgBoxType + '_num').html(msg.replace('{0}', users)).show();
        }
        else {
            //未购买过
            $('#div_' + InboxEngine.MsgBoxType + '_num').html(InboxParams['isorder']).show();
        }
    }
    else {
        $('#div_' + InboxEngine.MsgBoxType + '_num').hide();
    }
    //重新设置弹框高度
    InboxEngine.ResetDivHeight();
}

InboxEngine.MsgBoxType = "";

/*绑定下拉框，公司、邮件模板*/
InboxEngine.InitDrop = function (initID) {
    $(initID).click(function (e) {
        var obj = $(this); //div_company_intvplan
        var type = obj.attr('id').split('_')[1];
        var attr = obj.attr('id').split('-')[1];
        obj.removeClass('active');
        if (obj.children('.gdownList').length <= 0 || obj.children('.gdownList').is(':hidden')) {
            $(this).children("input[type='text'][readonly='readonly']").css("border-color", "#5191ce");
            if (attr == 'c')
                $(this).find('div.gdownList').show();
            else {
                InboxEngine.GetTemplateList();
            }
        }
        else {
            e = e || window.event;
            src = e.target || e.srcElement;
            var targetId = src.getAttribute(attr) || '';
            var targetHtml = src.innerText || InboxParamsErr['plasechoosetime'];
            //判断触发是否为选择元素
            if (src.getAttribute(attr)) {
                var idtemp = InboxParams[type];

                $('#txt_' + type).val(targetHtml);
                if (targetId != '0') {
                    //选择的内容
                    InboxParams['sel_' + type] = targetHtml;
                    //选择的id
                    InboxParams[type] = targetId;
                    $('#txt_' + type).css('color', '#3b3b3b');
                }
                else {
                    InboxParams['sel_' + type] = "";
                    $('#txt_' + type).css('color', '#b4b4b4');
                    InboxParams[type] = '';
                }
                //如果是模板，需要获取模板信息
                //if (attr == 't') {
                //有变化时才获取
                if (idtemp != targetId) {
                    //测评
                    if (src.getAttribute('isenough'))
                        EHRRsmBox.GetRsmNum();
                    else
                    //其他情况
                        InboxEngine.GetTemplateContent(src);
                }
                //}
                $(this).find('div.gdownList').hide();
            }
        }
    });
    $(initID).each(function () {
        //绑定鼠标移除事件
        $(this).mouseleave(function () {
            if ($(this).children("input[type='text']").attr("readonly")) {
                //隐藏下拉框
                $(this).children(".downList,.gdownList").hide();
                if (!$(this).hasClass('active'))
                //更改边框样式
                    $(this).children("input[type='text']").css("border-color", "#c4c4c4");
            }
            return false;
        });
    });
}
/*设置选中的用户名样式*/
InboxEngine.SetSelectUser = function () {
    var obj = $('#' + EHRBox.config.curBoxID).find("p[id$='_resume_selected']");
    //ie7兼容问题
    if (browser.msie && browser.version < 8) {
        //默认高度20px
        if (obj.css('height') == '20px') {
            obj.css('height', 'auto');
            obj.find('i').attr('class', ' icon icon-angle-down');
        } else {
            obj.css('height', '20px');
            obj.find('i').attr('class', ' icon icon-angle-up');
        }
    }
    else {
        if (obj.attr('height') == 'auto') {
            obj.attr('height', '').css('height', '');
            obj.find('i').attr('class', ' icon icon-angle-up');
        } else {
            obj.attr('height', 'auto').css('height', 'auto');
            obj.find('i').attr('class', ' icon icon-angle-down');
        }
    }
}

/*错误信息获取*/
//获取错误提示信息
InboxEngine.GetErrorContent = function () {
    var postData = { doType: 'GetErrorContent' }
    EHR.Common_AsyncHandle("POST", "xml", "../Ajax/InboxResume/GlobalInboxCommonAjax.ashx", postData, InboxEngine.GetErrorContentResult, 0);
}
//将错误提示组合，替换掉{0}
InboxEngine.GetErrorTip = function (error, error1) {
    return error.replace("{0}", error1);
}
InboxParamsErr = {};
InboxEngine.GetErrorContentResult = function (result) {

    //请输入有效的E-mail地址！
    InboxParamsErr['plaseinputvalidemail'] = $(result).find("plaseinputvalidemail").eq(0).text();
    //最多可输入3个Email！
    InboxParamsErr['caninputmax3email'] = $(result).find("caninputmax3email").eq(0).text();
    //第{0}个Email错误，请输入有效的Email!
    InboxParamsErr['commonemailerr'] = $(result).find("commonemailerr").eq(0).text();
    //{0}不能为空！
    InboxParamsErr['commoncannotnull'] = $(result).find("commoncannotnull").eq(0).text();
    //{0}只支持纯文本内容！
    InboxParamsErr['commoncaninputtxt'] = $(result).find("commoncaninputtxt").eq(0).text();
    //标签
    InboxParamsErr['label'] = $(result).find("label").eq(0).text();
    //信件主题
    InboxParamsErr['mailsub'] = $(result).find("mailsub").eq(0).text();
    //信件内容
    InboxParamsErr['mailcontent'] = $(result).find("mailcontent").eq(0).text();
    //发件人
    InboxParamsErr['mailusername'] = $(result).find("mailusername").eq(0).text();
    //最多可输入{0}个字！
    InboxParamsErr['commoninputmax'] = $(result).find("commoninputmax").eq(0).text();
    //获取导出令牌失败不能进行导出！   
    InboxParamsErr['gettokeniderr'] = $(result).find("gettokeniderr").eq(0).text();
    //确定要推荐职位吗？ 简历将会被移除到被推荐职位的收件箱中。
    InboxParamsErr['issurereposition'] = $(result).find("issurereposition").eq(0).text();
    //确定要放入人才夹？收件箱将不再保存该简历，简历中的操作信息也将自动清除。
    InboxParamsErr['issuremovetohr'] = $(result).find("issuremovetohr").eq(0).text();
    //确定要放入回收站？回收站的简历放入15天后自动删除。
    InboxParamsErr['issuremovetorub'] = $(result).find("issuremovetorub").eq(0).text();
    //请输入{0}名称！
    InboxParamsErr['commonplaseinput'] = $(result).find("commonplaseinput").eq(0).text();
    //标签名称最多为6个中文或12个英文字符！
    InboxParamsErr['labelerr'] = $(result).find("labelerr").eq(0).text();
    //最多输入6个中文或12个英文字符！
    InboxParamsErr['deflabel'] = $(result).find("deflabel").eq(0).text();
    //确定要删除标签吗？
    InboxParamsErr['issuredeletelabel'] = $(result).find("issuredeletelabel").eq(0).text();
    //短信余额不足！
    InboxParamsErr['msgnotenough'] = $(result).find("msgnotenough").eq(0).text();
    //简历评语
    InboxParamsErr['resumemark'] = $(result).find("resumemark").eq(0).text();
    //第{0}轮面试
    InboxParamsErr['interview'] = $(result).find("interview").eq(0).text();
    //对不起，您尚未开通测评邀请权限！<br />请联系贵公司管理员。
    InboxParamsErr['rsmnobuy'] = $(result).find("rsmnobuy").eq(0).text();
    //请选择
    InboxParamsErr['plasechoose'] = $(result).find("plasechoose").eq(0).text();
    //请选择生效日期！
    InboxParamsErr['plasechoosetime'] = $(result).find("plasechoosetime").eq(0).text();
    //起始日期必须小于结束日期！
    InboxParamsErr['starttimenotlessthanendtime'] = $(result).find("starttimenotlessthanendtime").eq(0).text();
    //测评邀请数不足
    InboxParamsErr['rsmnotenough'] = $(result).find("rsmnotenough").eq(0).text();
    //是否确认发送？
    InboxParamsErr['issuresend'] = $(result).find("issuresend").eq(0).text();
    //联系购买
    InboxParamsErr['contactbuy'] = $(result).find("contactbuy").eq(0).text();
    //请选择发信公司！
    InboxParamsErr['mailcompany'] = $(result).find("mailcompany").eq(0).text();
    //内容已到{0}个字，不可再输入！
    InboxParamsErr['commoncontent'] = $(result).find("commoncontent").eq(0).text();
    //当前输入{0}个字
    InboxParamsErr['commoncurinput'] = $(result).find("commoncurinput").eq(0).text();
    //内容字数已满2条，不可再输入！
    InboxParamsErr['msgwordthan2'] = $(result).find("msgwordthan2").eq(0).text();
    //内容已超过1条，需发送第二条！
    InboxParamsErr['msgwordthan1'] = $(result).find("msgwordthan1").eq(0).text();
    //加载中。。。
    InboxParamsErr['loading'] = $(result).find("loading").eq(0).text();
    //最多只允许查询{0}个项目
    InboxParamsErr['max10item'] = $(result).find("max10item").eq(0).text();
    //请选择显示字段
    InboxParamsErr['plasechoosecol'] = $(result).find("plasechoosecol").eq(0).text();
    //确定要放入人才夹吗
    InboxParamsErr['movehrConfirm'] = $(result).find("movehrConfirm").eq(0).text();
    //确实要删除吗？
    InboxParamsErr['delconfirm'] = $(result).find("delconfirm").eq(0).text();
    //删除失败，请稍后再试！
    InboxParamsErr['delerr'] = $(result).find("delerr").eq(0).text();
    //放入人才夹失败，请稍后再试！
    InboxParamsErr['movehrerr'] = $(result).find("movehrerr").eq(0).text();
    //不限
    InboxParamsErr['unlimite'] = $(result).find("unlimite").eq(0).text();
    //请输入
    InboxParamsErr['plaseinput'] = $(result).find("plaseinput").eq(0).text();
    //请选择
    InboxParamsErr['plaseselect'] = $(result).find("plaseselect").eq(0).text();
    //放入人才夹权限check
    InboxParamsErr['movehrWarning'] = $(result).find("movehrWarning").eq(0).text();
    //放入回收站权限check
    InboxParamsErr['moverbWarning'] = $(result).find("moverbWarning").eq(0).text();
    //简历批量处理，放入回收站提示
    InboxParamsErr['moverbconfirm'] = $(result).find("moverbconfirm").eq(0).text();
    //简历批量处理多窗口事件
    InboxParamsErr['taskconfirm'] = $(result).find("taskconfirm").eq(0).text();

}
//筛选栏弹层
InboxEngine.CommMasks = "popupArea";
InboxEngine.PrivMasks = "EHRDivBoxfun,EHRDivBoxmajor,EHRDivBoxind,div_ExportBoxHtml,div_ForwardBoxHtmlNew,div_AddLabelBoxHtml,div_SendMsgBoxHtml,div_ScreenBoxHtml,div_IntvBoxHtml,div_RmsBoxHtml,div_OfferBoxHtml";
InboxEngine.setMask = function () {
    if (!$('.th_downList')) return false;
    InboxEngine.initDiv();
    var gbDiv = $("#globalDiv");
    if (gbDiv && gbDiv.css('display') && gbDiv.css('display') != 'none') {
        var gbMasks = InboxEngine.CommMasks;
        var gbDivbox = document.getElementById(gbMasks);
        if (gbDivbox && gbDiv.css('display') != 'none') {
            MoveToCenter(gbDivbox);
            gbDiv.css({ 'height': $(document).height(), 'width': $(document).width() });
        }
    } else {
        var mask = $("#DivBoxMask");
        if (mask && mask.css('display') && mask.css('display') != 'none') {
            mask.css({ 'height': $(document).height(), 'width': $(document).width() });
            var PrMasks = InboxEngine.PrivMasks.split(',');
            for (var j = 0, length = PrMasks.length; j < length; j++) {
                var tip_box = document.getElementById(PrMasks[j]);
                var box = "";
                if (tip_box && tip_box.style.display != "none") {
                    box = tip_box;
                } else { continue; }
                if (box && box.style.display != 'none') {
                    MoveToCenter(box);
                }
            }
        }
    }
}
InboxEngine.initDiv = function () {
    if ($('#divdrop_label').css('display') == 'block' || $('#divdrop_process').css('display') == 'block') {
        var mleft;
        var divactive;
        if ($('#divdrop_label').css('display') == 'block') {
            mleft = $('#columnlabel').parent('div').offset().left - $('div.fn-main.list-main').offset().left - 11;
            divactive = $('#divdrop_label');
        }
        if ($('#divdrop_process').css('display') == 'block') {
            //$('#columnprocess').offset().left 相对于边框的偏移量
            //$('div.fn-main.list-main') 父级div偏移量
            //10  columnprocess的10px偏移量
            mleft = $('#columnprocess').offset().left - $('div.fn-main.list-main').offset().left - 35;
            divactive = $('#divdrop_process');
        }
        divactive.css({
            'margin-left': mleft + 'px'
        });
    }
}
InboxEngine.disposeSafari = function () {
    //解决safari上问题
    if (browser.safari) {
        $('#divdrop_process,#divdrop_label').bind('mouseleave', function () {
            $(this).css({ 'display': 'none' });
        });
    }
}
InboxEngine.taskContinue = function () {
    window.location.href = 'InboxTask.aspx?PageFrom=' + $('#hidPageFrom').val();
}
InboxEngine.taskView = function () {
    window.location.href = 'InboxTaskView.aspx?PageFrom=' + $('#hidPageFrom').val();
}
InboxEngine.closePage = function () {
    if (navigator.userAgent.indexOf("MSIE") > 0) {
        if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {
            window.opener = null; window.close();
        }
        else {
            window.open('', '_top'); window.top.close();
        }
    }
    else if (navigator.userAgent.indexOf("Firefox") > 0) {
        window.location.href = 'about:blank ';
    }
    else {
        window.opener = null;
        window.open('', '_self', '');
        window.close();
    }
}
InboxEngine.WhileDoTask = function (enable) {
if(!enable) {
    init();
  }else{
        $('#export').unbind('click').click(function(){});
        $('#label').unbind('click').click(function(){});
        $('#moveHr').unbind('click').click(function(){});
        $('#moveRub').unbind('click').click(function(){});
        $(".fn-main-tab-text").find("a").attr("href", "JavaScript:void(0);");
  }
$('#Export').attr('disabled',enable); 
enable ? $('#export').css({ 'color': '#9e9e9e' }) :
 $('#export').css({ 'color': '#3b3b3b' });

$("#MoveHr").attr('disabled',enable);
enable ? $('#moveHr').css({ 'color': '#9e9e9e' }) :
 $('#moveHr').css({ 'color': '#3b3b3b' });

$("#Label").attr('disabled',enable);
enable ? $('#label').css({ 'color': '#9e9e9e' }) :
 $('#label').css({ 'color': '#3b3b3b' });

$("#MoveRub").attr('disabled',enable);
enable ? $('#moveRub').css({ 'color': '#9e9e9e' }) :
 $('#moveRub').css({ 'color': '#3b3b3b' });
}
/****************记录日志**************/
//记录日志，页面需要添加pageNo隐藏值
//近半年简历页面
InboxParams['24'] = { 'Export': { 'middle': '6', 'bottom': '19' }, 'RePosition': { 'middle': '7', 'bottom': '20' }, 'MoveToHR': { 'middle': '8', 'bottom': '21' }, 'MoveToRub': { 'middle': '9', 'bottom': '22' }, 'AddLabel': { 'middle': '11', 'bottom': '23' }, 'RemoveLabel': { 'middle': '12', 'bottom': '24' }, 'SendMessage': { 'middle': '10', 'bottom': '25' }, 'Screen': { 'middle': '13', 'bottom': '26' }, 'Forward': { 'middle': '14', 'bottom': '27' }, 'IntvPlan': { 'middle': '15', 'bottom': '28' }, 'Rms': { 'middle': '16', 'bottom': '29' }, 'Offer': { 'middle': '17', 'bottom': '30' }, 'FasterLabel': { 'middle': '33', 'bottom': '34'} }
//收件箱--应聘简历
InboxParams['25'] = { 'Export': { 'middle': '8', 'bottom': '22' }, 'RePosition': { 'middle': '9', 'bottom': '23' }, 'MoveToHR': { 'middle': '10', 'bottom': '24' }, 'MoveToRub': { 'middle': '11', 'bottom': '25' }, 'AddLabel': { 'middle': '14', 'bottom': '27' }, 'RemoveLabel': { 'middle': '15', 'bottom': '28' }, 'SendMessage': { 'middle': '13', 'bottom': '29' }, 'Screen': { 'middle': '16', 'bottom': '30' }, 'Forward': { 'middle': '17', 'bottom': '31' }, 'IntvPlan': { 'middle': '18', 'bottom': '32' }, 'Rms': { 'middle': '19', 'bottom': '33' }, 'Offer': { 'middle': '20', 'bottom': '34' }, 'FasterLabel': { 'middle': '37', 'bottom': '38' }, 'MoveToInbox': { 'middle': '12', 'bottom': '26'} }
//人才夹--下载简历，应聘简历，我的简历
InboxParams['28'] = { 'Export': { 'middle': '6', 'bottom': '14' }, 'RePosition': { 'middle': '8', 'bottom': '16' }, 'MoveToRub': { 'middle': '9', 'bottom': '17' }, 'AddLabel': { 'middle': '11', 'bottom': '18' }, 'RemoveLabel': { 'middle': '12', 'bottom': '19' }, 'SendMessage': { 'middle': '10', 'bottom': '20' }, 'Forward': { 'middle': '7', 'bottom': '15' }, 'FasterLabel': { 'middle': '23', 'bottom': '24'} }
//人才夹--导入简历
InboxParams['31'] = { 'RePosition': { 'middle': '5', 'bottom': '5' }, 'MoveToRub': { 'middle': '6', 'bottom': '6'} }
//回收站，未使用
InboxParams['32'] = { 'Export': { 'middle': '7', 'bottom': '7' }, 'Forward': { 'middle': '8', 'bottom': '8' }, 'MoveToHR': { 'middle': '9', 'bottom': '9'} }
InboxEngine.AddLog = function (opr, e) {
    var pageNo = $('#pageNo').val();
    //回收站不走这里
    if (pageNo && pageNo == "32")
        return;
    //是否已记录过
    if (InboxParams['hidSeqID'] && (opr == 'Forward') && pageNo && pageNo != "25" && pageNo != "24" && InboxParams[opr]) {
        InboxParams[opr] = 0;
        return;
    }
    if (InboxParams['hidSeqID'] && (opr == 'RePosition' || opr == 'MoveToRub') && pageNo && pageNo == "31" && InboxParams[opr]) {
        InboxParams[opr] = 0;
        return;
    }
    //日志页面号
    if (pageNo) {
        var tmp = pageNo;
        //我的简历，应聘简历，
        if (pageNo == "29" || pageNo == "30")
            tmp = '28';
        if (InboxParams[tmp][opr]) {
            var pageEvent = "";
            if (opr != "FasterLabel") {
                //单条操作
                if (InboxParams['rowid'])
                    pageEvent = InboxParams[tmp][opr].middle;
                else
                    pageEvent = InboxParams[tmp][opr].bottom;
            }
            else {
                //快速添加标签
                e = e || window.event || EHRLabelBox.MouseEvent || getEvent();
                var target = e.target || e.srcElement;
                //点击+图标
                if (target.tagName.toLowerCase() == "i") {
                    pageEvent = InboxParams[tmp][opr].bottom;
                }
                else {//点击文字
                    pageEvent = InboxParams[tmp][opr].middle;
                }
            }
            EHR.Common_AsyncAddLog(pageNo, pageEvent, '');
            InboxParams[opr] = 1;
        }
    }
}
/****************添加小精灵Log start add by zhoug 20170925************/
InboxEngine.AddResumeLog = function (eventtype) {
    if (typeof (page_code) != "undefined" && page_code != "0" && page_code != "") {
        var refPageCode = ",24,25,26,27,28,29,30,31,";
        if (refPageCode.indexOf("," + page_code + ",") > -1) {
            EHR.Common_AsyncAddLog("7", eventtype, '1' + str_char22 + page_code);
        }
    }
}
$(function () {
    $("#tabJL1").live('click', function () { InboxEngine.AddResumeLog("3"); });
    $("#tabCZ2").bind('click', function () { InboxEngine.AddResumeLog("4"); });
    $("#tabTX3").live('click', function () { InboxEngine.AddResumeLog("5"); });
    $(".p_bottom").bind('click', function () { InboxEngine.AddResumeLog("20"); });
});
/****************添加小精灵Log end************/
/****************添加快速反馈 start**************/
$(function () {
    $(".ev-mark-tips").bind('mouseover', function () {
        /* Act on the event */
        $(this).children('.ev-mark-tips00').addClass('ev-block00 fadeInLeft animated')
    });

    $(".ev-mark-tips").bind('mouseleave', function () {
        /* Act on the event */
        $(this).children('.ev-mark-tips00').removeClass('ev-block00 fadeInLeft animated')
    });

});

$(function () {
    $(".ev-mark-tips").bind('mouseover', function () {
        /* Act on the event */
        $(this).children('.ev-mark-tips01').addClass('ev-block00 fadeInLeft animated')
    });

    $(".ev-mark-tips").bind('mouseleave', function () {
        /* Act on the event */
        $(this).children('.ev-mark-tips01').removeClass('ev-block00 fadeInLeft animated')
    });

});





/****************添加快速反馈 END**************/


/****************记录日志 END**************/